Help: High Score Rounds Up

salino2835salino2835 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

  • salino2835salino2835 Member, PRO Posts: 76

    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.

  • pHghostpHghost London, UKMember Posts: 2,342
    edited March 2018

    What type of attribute is game.score and game.high_score?

  • salino2835salino2835 Member, PRO Posts: 76

    @pHghost

    game.Score is Real

    game.high_score is an Integer

    Does that mean game.high_score should be Real?

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited March 2018

    @salino2835 said:
    @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

  • pHghostpHghost London, UKMember Posts: 2,342

    Yes. If you apply a real to an integer, it gets integer-ized— essentially rounded.

Sign In or Register to comment.