It's certainly possible in MMF. For TGF, check out Tigerworks' simple example of 360 degree car movement on his website (www.tigerworks.co.uk), but I think if you want anything especially realistic you'd need to use MMF. It'd be good if someone could prove me wrong though...
i think that the car physics alone are not that hard, but if you are making a game with more cars it will be hard to do realistic collisions. most of click games only bounce or stop the cars that collide.
Ok, here's a quick but oh-so effective way. You have 2 objects, one represents the driving force (racecar movement), the other the drag (Bounceball movement). The drag is set so that when is doesn't overlap the driving force, and it's speed is less than that of the driving force, it adds one to it's speed. It also always looks in the direction of the driving force, so in effect it will follow it around. Now you make both of these invisible and create your graphical car (Static) and set it to the average of these possitions ((rag+rive)/2 etc) and make it always look in direction of the driving force. Presto- quite good driving physics, complete with skidiness (which works especially well on corners). Collisions are a nightmare though, but there are ways round this.
Why the hell am I on the computer at 1 in the morning? No, don't answer.
Theoretically, a semi-realistic (barely noticable) shouldn't be too hard. Just keep track of the following things:
- Car weight
- Engine power
- Acceleration (based on car weight & engine power)
- Inertia (for curves and stuff)
- Deceleration (based on weight & friction/brakes)
- Momentum (weight*speed, more for crashes)
Yep, that's about it. Harder to do than it sounds, but not that tough. Two active objects and a lotta alterable values should do the trick.
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.
Sure thing. Glad to help. Basically, you want a race car object, and a bouncing ball object. Tell the bounceball that when it doesn't overlap the racecar (if your using TGF, tell me if you're on KnP-there are ways round this) and it's speed is less than that of the racecar, then add one to speed. Tell the bounceball to stop when the two overlap. Then make them both invisible, and make a new object that actually looks like a car (the others should probably just be circles)but it should be on static movement (none) and always set it's X cooordinate to (Xracecar+ Xbounceball)/2 and Y coordinate to Yracecar+ Ybounceball)/2. Lastly tell it to always look in the direction of the racecar movement object. Hope that helps.
Why the hell am I on the computer at 1 in the morning? No, don't answer.
Assault Andy Administrator
I make other people create vaporware
Registered 29/07/2002
Points 5686
25th September, 2003 at 20:31:36 -
Jimmy - That method doesn't work to well, and you forgot to include that when the two objects aren't overlapping each other, then start the movement of the bouncy ball drag. Because otherwise it doesn't go anywhere. Also you need to make the bouncy ball always look at the racing car which you said in your first post of the technique. I find this doesn't work very well but if you can show an example or something - maybe i'm doing it wrong.