Goes to 9960...

GnomerGnomer Member Posts: 292
edited November -1 in Working with GS (Mac)
Ok so i have a custom score counter with my own images as shown in the gamesalad cookbook score tutorial 3.

Basically when you kill something you gain 10 points and when you die you lose 50. When you are on 10 and you die your score goes from 0010 to 9960,

How can i prevent this from happening?

Thanks

Comments

  • RHRH Member Posts: 1,079
    I don't know why it's going to 9960 (I can see where that is coming from though) but to solve your problem it just seems that you need to make it so the score can't be a negative number.

    Where you have the change attribute game.score to game.score-50 just change it to change attribute game.score to max(0,game.score-50). Hopefully that should do the trick.
  • GnomerGnomer Member Posts: 292
    Thanks i'll give it a go
  • GnomerGnomer Member Posts: 292
    Worked :) Thanks.
Sign In or Register to comment.