Sign in to follow this  

Trying to figure out gallons used in a car simulator

Recommended Posts

I'm currently working on a Car System Simulator for educational use in Tech. Ed. classes. My partner and I are using Adobe Director 11.5 and I'm using the Lingo scripting language to code all the functionality for the 'game.' I've run into a problem, though, regarding the interaction between the gas gauge and the variable that keeps track of how many gallons of gas have been used. I've got a few variables: gallonsUsed milesTraveled mpg Now, every time a gallon of gas is used I would like the needle on the gas gauge to rotate -12 degrees, I've got that part down. What I can't seem to figure out is how to get the simulator to detect when it passed the next "threshold" of the gallons, when a full gallon of gas has been used. The milesTraveled is a float with 4 decimal points due to our math (.5 real time = 1 minute game time) which is why I can't really use the mod operator (milesTraveled mod mpg)

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this