Pages: 1
Topic closed
Im making a scratch game where your a race car, with a moving backround and other racecars going against you. I know how to do moving backrounds and such, and how to make the backround move in certain ways compared to your angle and speed, but my ONLY problem is....
The other racecars that race against you are sopposed to automatically know where to go. I've got that part down. (on how to make them think on their own depending on how the race track looks(where to turn, speed, stay strait)) BUT, how do I get the other cars to go off the screen and have their turning move them in certain directions to make their x and y co-ordinates to make them crash or vear off or speed up in front of you then accidentally shift back behind you.
Right now, My script just makes it seem like paint on the road, because it moves with the backround.
Here is the script I have right now:
<when green flag clicked>
<go to x 21 )y 61 )
<forever>
<set{ yellow car angle }to( <direction> )
<go to x (( (( <{ ScrollX }> <+> (( <{ yellow car speed }> <*> <sin( <{ yellow car angle }> )) )) <+> 21 )) )y (( (( <{ ScrollX }> <+> (( <{ yellow car speed }> <*> <cos( <{ yellow car angle }> )) )) <+> 61 )) )
Thanks allot!
P.S. this uses allot of trigonomitry and a little of algebra, so if you dont understand those, don't bother, but chanks for stopping by.
Offline
Well, sin and cos are mixed up. (I'm pretty sure, any way)
Offline
Topic closed
Pages: 1