I am in the midst of researching how to create a Roller Coaster Simulator in Flash and have not found any examples of code on how to go about it. I’ve read about motion along a path as well as the physics of velocity, gravity, acceleration, and slope but I am not sure where to start and how to put it all together.
The simulator will allow the player to modify sections of track. So for example, they can choose between 3 different sizes of hill for the first section of track. When they test the track a graph will show how velocity changes over time as the roller coaster moves along the track.
So I’ve got a few questions:
Should I have the roller coaster follow a modifiable path or use hitTest. How do I get the roller coaster cars to follow the curve and rotate accordingly?
What’s the best way to calculate the change in velocity of the roller coaster depending on the slope of the hill/curve chosen? How do you calculate the velocity to be graphed over time?
I’d like to do something similar to the following two roller coaster apps in Flash:
http://puzzling.caret.cam.ac.uk/game.php?game=roller
http://www.eduplace.com/kids/hmsc/activities/simulations/gr4/unitf.html
Any suggestions or pointers would be greatly appreciated.
Thanks in advance.
joeAction