Help: High Score Rounds Up
salino2835
Member, PRO Posts: 76
In my game you have to try and last as long as possible without getting hit. The "Score" counts up in seconds and has milliseconds as well. And I have the high score change to game.score when game.score is > game.high score. (see screenshots)
I cant seem to get game.high score to display the millisecond, it always rounds up. For example if you lasted 7.8 seconds, the high score will display 8 seconds. I want it to display 7.8 seconds.
I have attached my code: Hopefully this will help explain more. Can someone please help me and tell me what im missing.
Thanks in Advance
Comments
also in the 3rd rule in the screenshots if I have display text game.score.."s" where you see display text game.high score.."s" that will show the score with the milliseconds.
What type of attribute is game.score and game.high_score?
@pHghost
game.Score is Real
game.high_score is an Integer
Does that mean game.high_score should be Real?
Yes. Integers are whole numbers. So if you want decimals, you need to use a real attribute.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Yes. If you apply a real to an integer, it gets integer-ized— essentially rounded.