Counting Down Using Interpolate

AppFueledAppFueled Member Posts: 308
edited November -1 in Working with GS (Mac)
I'm using T Shirt Booths tutorial on counting down using interpolate. When I finish my level, lets say I have 500 points. Everything works fine except the only thing I don't like is that when it counts down it also uses decimals.

For example, 500 is the level score. It counts down and looks like: 476.64. I don't want the decimal to be there. I want these to be whole numbers. Any suggestions?

Comments

  • AsymptoteellAsymptoteell Member Posts: 1,362
    Use floor.
  • AppFueledAppFueled Member Posts: 308
    TShirtBooths tutorial for Interpolate does not use floor. I got everything working, I just need to know how to eliminate the places after the decimal.
  • AsymptoteellAsymptoteell Member Posts: 1,362
    Thats the thing. You need to put floor(game.score)
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    Asymptoteell said:
    Thats the thing. You need to put floor(game.score)

    +1. floor is the expression to round to a whole number
  • AppFueledAppFueled Member Posts: 308
    I see. How would the expression look written out?
  • AppFueledAppFueled Member Posts: 308
    wait, so this is how the expression is written out: floor(game.score)
  • AppFueledAppFueled Member Posts: 308
    when I put this equation in the attribute: floor(game.score) it does not work. Am I doing something wrong?
  • AsymptoteellAsymptoteell Member Posts: 1,362
    I think that's how.
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    yes thats how, do it like this

    click the e and open up the expression editor, type in floor then ( then select your attribute from the drop down and type )

    try like that instead of selecting floor from the drop down
  • AppFueledAppFueled Member Posts: 308
    Hey John, I appreciate your help but it still isn't working. I am using INTERPOLATE. According to the video I am suppose to put (game.score) in the space for "interpolate attribute." If I try to add "floor" it doesn't stick.
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    i havent seen the video, but if the interpolate is whats changing the score down every so often, ithe problem where your putting floor. I think whenever you have the score done counting, put a change attribute behavior change game.score to floor(game.score), or if your displaying the score at the end with display text display it as floor(game.score)
  • AsymptoteellAsymptoteell Member Posts: 1,362
    Right! Display text floor(game.floor)
  • AsymptoteellAsymptoteell Member Posts: 1,362
    Game.score I mean.
  • AppFueledAppFueled Member Posts: 308
    Guys, thanks for your help. Got it to work. Turns out I had to select both "floor" and "the score attribute" from the drop down menu. Thanks again for your patience.
Sign In or Register to comment.