Jump to content
  • Advertisement
Sign in to follow this  

Trying to figure out gallons used in a car simulator

This topic is 3398 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!