Interpolating Score question
Hi community,
I followed T-shirt booth's tutorial on how to use your own custom font numbers and link that with your score. My game is working that just fine, but the thing is, i want to make the numbers which are unused to be hidden.
for example, it displays "0000" at the beginning of the game. slowly as the score builds up, the div attribute allows the placeholder to work, eventually going up to a score of say "0389".
I'd like to have it not show the 1000s, 100s or 10s column at the beginning (just a score shown as "0") and then when the score is right then the new number shows, ie. hiding the zeroes.
Is there anyway to do this? I've tried messing around with colour, images, transparency, and the such with no luck. it may be possible to have a different actor for every "0" instead of having one actor pasted 4 times and edited to make the "div" 10, 100, 1000 etc. like i'm doing now, but having so many actors would lose out on performance.
any ideas?
I followed T-shirt booth's tutorial on how to use your own custom font numbers and link that with your score. My game is working that just fine, but the thing is, i want to make the numbers which are unused to be hidden.
for example, it displays "0000" at the beginning of the game. slowly as the score builds up, the div attribute allows the placeholder to work, eventually going up to a score of say "0389".
I'd like to have it not show the 1000s, 100s or 10s column at the beginning (just a score shown as "0") and then when the score is right then the new number shows, ie. hiding the zeroes.
Is there anyway to do this? I've tried messing around with colour, images, transparency, and the such with no luck. it may be possible to have a different actor for every "0" instead of having one actor pasted 4 times and edited to make the "div" 10, 100, 1000 etc. like i'm doing now, but having so many actors would lose out on performance.
any ideas?
Comments
I made unique actors for each integer of the score. (the placeholders)
on each of those actors, I used the same rules I just described, except on the actors these rules are only used to move the actors left or right based on how many digits in the score.
EDIT: I read my explanation and decided that I failed...
Heres an image that may explain the same thing better.
Notice that each actor is spawning +16 to the right of the previous.
And in the pictured method I destroy my score actors when the score reaches 1000
(because the rule spawns the actor again, just in a different place. you could also just add a "move" rule to each actor as I was describing in my initial response, and avoid spawn & destroy.)
You could do what @3itg said about if score is greater than self.
You could just place them where you want. Change their alpha to zero. Then make a self.attribute for the score actors. And say if score is great than self.attribute than change alpha to one.
For example
For your tens column actor. Change alpha to 0.
Create self.score and change it to 9. Then create rule where if game score is greater than self.score (9) then change alpha to 1.
Hope this helps.
All the best
JobApp
Good to hear that they both worked for you.
Good luck in making your game
If you need help with anything you can always send me a PM and i will try and help!
All the best
JonApp
Darren.