custom score font problem
evert
Member Posts: 266
Hi all!
i'm having something strange going on.
My custom font won't work.
what is happening?
My score integer defines the div integer of the font.
floor((game.score%self.div)/(self.div/10)).."png"
When i set my score integer at lets say 999 the game starts with my custom font at a score of 999.
But when the score changes, nothing happens and it stays 999.
when i make a display text with game.score it show perfectly.
How come it does not change?
And yes i did do div 10 div 100 div 100.... to each number
thanks
New game!: [Snake Rage]https://itunes.apple.com/us/app/snake-rage/id1463859909
Comments
Did you put ".png" not "png"
@evert,
Hello. Looking at the above, you're missing a period within the quotes - ".png" . Check that out.
The floor expression figures out the number, then the .. joins the number with .png , the file suffix.
Also, you should have used the expression in a "contain attribute" behavior or a very frequently updated "change attribute" behavior.
Good luck!
My Blog / App Store / Google Play
but it does respond when i change my attribute integer directly to lets say 999..
it does not respond to change when the game plays.
New game!: [Snake Rage]https://itunes.apple.com/us/app/snake-rage/id1463859909
Are you using the "constrain" behaviour or the "change" attribute?
You should be constraining the image not changing the image.
Failing that, please post a screen shot of the logic so we can see what you have inside.
Is it "Change attribute" or "Constrain attribute"?
It has to be a Constrain, or else it won´t change.
Mental Donkey Games
Website - Facebook - Twitter
@evert,
If that is the case, check your game logic. You could be missing a rule where upon a certain event occurs score = score+ 100 (or whatever) points .
My Blog / App Store / Google Play
Thanks guys! i indeed used a change attribute!
fixed it now!
thanks again
New game!: [Snake Rage]https://itunes.apple.com/us/app/snake-rage/id1463859909
@evert , you're welcome. Keep in mind, though, a change attribute will update only once (unless you use a timer to update every fraction of a second or so), while a constrain attribute will update constantly (although at the expense of performance, so using too many of these is not recommended).
My Blog / App Store / Google Play
I think what he was saying was he "was" using a change attribute (like I suggested he might be doing), that was the issue.