deducting game score

app-etiteapp-etite Member Posts: 139
edited November -1 in Working with GS (Mac)
Hi,

I followed tshirtbooths cookbook tutorial on how to use your own fonts for game scores etc and it all works fine.
But I have 4 zeros displayed when the game starts and have a rule saying when actor hits an object then take away minus 10 points but the the score is then displaying 9950, obviously looping back around, I know it works easily if you just use display text. Any way to have it display -50 or -0050 or something with my custom font??

Thanks

Comments

  • SlickZeroSlickZero Houston, TexasMember, Sous Chef Posts: 2,870
    The attribute you create for the score keeping needs to be an "integer" so it can do both positive and negative numbers.
  • app-etiteapp-etite Member Posts: 139
    it is an integer, I have the first 0 with a divider attribute at 10000, second 0 at 1000, third 0 at 100 and fourth 0 at 10 just like tshirtbooth explained on the video. so the integer is working but its displaying negative downwards from 10 thousand so it will say 9950 and so on. again I can do this easy using display font and have it display -50 with standard fonts but i want to use my own font which is trickier.

    Anybody ever done this?
  • JeffreyShimaneJeffreyShimane Member Posts: 372
    In your game, does the score only go down and never up?

    If so, maybe something like this would work. Create a graphic of the dash/minus sign using the font you used for the numbers. Create an actor with this graphic, change the opacity to 0, and place it next to the numbers of your score. Use the absolute expression to convert your score from a negative number to a positive number (or you could change your subtraction to addition when hit so that your score goes up instead of down). Create a rule in the actor you just created that checks if the score is equal to 0. If it's equal to 0, change the opacity attribute to 0, otherwise, change the opacity attribute to 1. Basically, it should show the starting score (0000) but when the player gets hits, the score will go up but the dash/minus sign will appear before the number so it will appear as a negative score.

    I don't think this method would work if your score could be either positive or negative though.
  • app-etiteapp-etite Member Posts: 139
    my game goes up when he collects items and down when he bumps into objects. so if he bumps into something before he collects stuff then its gonna end up minus from zero
  • JeffreyShimaneJeffreyShimane Member Posts: 372
    This should work:

    1) Create a graphic of the dash/minus sign using the font you used for the numbers.
    2) Create an actor with this graphic and place it to the left of your score.
    3) Create a rule in the actor you just created that checks if the score is less than 0. If it's less than 0, change the opacity attribute to 1, otherwise, change the opacity attribute to 0.

    The minus sign should only appear when the score is less than 0 (a negative number). If it's equal to or greater than 0, it will be invisible.
  • app-etiteapp-etite Member Posts: 139
    thanks jshimane for taking the time to give me an in-depth solution. i'll try these out now.

    Thanks

    -appetitegames
Sign In or Register to comment.