help with cars
Blitz3D Forums/Blitz3D Beginners Area/help with cars
| ||
can someone please get me some code for some race cars? -me |
| ||
You may need to be a tad more specific.... |
| ||
i'm trying to create a racing game, and i can't figure out how to do the other cars -me |
| ||
is anybody there? -me |
| ||
how long does it take for you people to anwser? -me |
| ||
i'm waiting |
| ||
You mean the ai? The simple way to make it quick is to drive a lap yourself and record it. Then play it back and you have a car that drives a lap on its own. Another way, more complicated is to use some sort of pathfinding sytem. |
| ||
i don't know how to record my lap -me ps can you type faster? |
| ||
you peoples take a long time to anwser -me |
| ||
You realise this is a forum, not a chatroom, right?? |
| ||
yeah |
| ||
So you understand that "on the odd occasion", it may take people longer than 30 seconds to reply to questions on here? |
| ||
just tell me how to record please -me |
| ||
make an array with x and y location and rotation of the car, store the data fx 32 times a sec. Export the values of your array to a file. |
| ||
If you ask me how to make an AI, define some points on track that the opponent cars should race towards, define where to break down to what speeds, where to give gas. Eventually make some rnd variations. |
| ||
Store the x,y locations in a array every so many milliseconds while you record. Also store the rotation for the car every time. Be sure to increase the counter of the array every time you record the position. The counter being used to see where to put the recording. Here is some crude example code ; this array will store 9999 positions. Or 499 seconds ; if you record every 20 milliseconds. dim cai(9999,3) ;This we use to time the recording global tm = millisecs() >Code for in your game loop ;Record every 20 milliseconds if tm + 20 < millisecs() then cai(counter,0) = carx cai(counter,1) = cary cai(counter,2) = carrot counter = counter + 1 tm = millisecs() end if >back to your start of the loop You could also use types for storing the position. This is just a simple example. And stop eating so much sugar :) ps - Be sure to store the array. Write it to a file. Look up the file functions. |
| ||
ok, i'll try that |
| ||
this isn't working. -me |
| ||
Here is a working example on how to record your mouse pointer. It should get you started.; ; Recording example ; Graphics 640,480,16,2 SetBuffer BackBuffer() Dim cai(999,3) Global tm = MilliSecs() Global recordlen = 0 ; This variable will store the total length of the recording Global playback = False Const recordrate = 20 While KeyDown(1) = False Cls Text 0,0,"Move the mouse around and then press the left mouse to play back" Text 0,20,"Position " + counter If playback=False And counter < 1000 Then If tm+recordrate < MilliSecs() Then cai(counter,0) = MouseX() cai(counter,1) = MouseY() counter = counter + 1 tm = MilliSecs() End If End If ; If MouseHit(1) = True Then playback = True : recordlen = counter : counter = 0 ; If playback = True Then If tm+recordrate < MilliSecs() Then Rect cai(counter,0),cai(counter,1),10,10,1 counter = counter + 1 If counter > recordlen Then counter = 0 End If End If Flip Wend |
| ||
it isn't working still bye for today -me |
| ||
what have you been smoking patisawesome seems you are a bit of a cheeky so and so. try and ask people in a friendly manner ,Instead of demanding anwers. i am actually surprised anybody answered you "ps can you type faster" ha ha thats just hilarious |
| ||
can someone give me the codes to make a game plz? hello? |
| ||
can someone give me the codes to make a game plz? hello? ;) You're so spot on with that one. ;) I participate in a lot of dance forums too (samplers, synths etc) and we get geezers like that all the time: Hi I'm a producer of TRANCE; "what chords for trance, what synths for trance, where can I get samples (loops) for trance...." |
| ||
where is you wife , i need a woman , hello ?? Bye for today |
| ||
lol@ bazziman. it's not even the vague questions. some ppl are just rude, especially when other ppl are here to help out of kindness. Not flaming, or not meaning too, but as ruz said, you could be a bit more polite. |
| ||
i think there's a problem with the syntax, well thank's anyways. i think i'm going to have to start over. bye, -me |
| ||
Pat, let me give you a few general tips here. 1. Do not post things like "You guys sure do take a long time to respond", or "Type faster". 2. Respect the veteran coders here since they will most often help you out. 3. Try something simple before you dive into heavy handed coding. It sounds to me like you havn't had any previous coding experience, and havnt tried learning the language yet. |
| ||
i'm sorry if i was being rude, i get ecxited doing proggraming, this is also the first time i'v joined a forum. -me |
| ||
It's cool. I don't think anyone is too bothered anyhow. Welcome to the board :D |
| ||
thanks, -me |