GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Help: High Score Rounds Up

salino2835salino2835 Posts: 76Member, PRO

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 Posts: 76Member, PRO

    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, UKPosts: 2,283Member
    edited March 2

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

  • salino2835salino2835 Posts: 76Member, PRO

    @pHghost

    game.Score is Real

    game.high_score is an Integer

    Does that mean game.high_score should be Real?

  • tatiangtatiang Posts: 11,419Member, Sous Chef, PRO, Senior Sous-Chef
    edited March 2

    @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, UKPosts: 2,283Member

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

Sign In or Register to comment.