Question about FMG:s custom fonts demo... animations?
Strobanik
Member Posts: 77
Hello!
Maybe I'm just daft but I can't seem to figure out how to use animations instead of png:s with Firemaplegames custom font demo.... In the infotext it says that you can easily use animations.. but I can't see how?
http://gamesalad.com/game/play/31065
Mr Fire Maple? Anybody else?
Thanks
nik
Maybe I'm just daft but I can't seem to figure out how to use animations instead of png:s with Firemaplegames custom font demo.... In the infotext it says that you can easily use animations.. but I can't see how?
http://gamesalad.com/game/play/31065
Mr Fire Maple? Anybody else?
Thanks
nik
Comments
To use animations, you must do this:
In the score glyphs actor, create a new Integer Attribute called 'myDigit' (without quotes).
Change the Constrain Attribute that is there to this:
Constrain Attribute
self.myDigit To: floor(( game.currentScore % self.divisor )/( self.divisor /10))
And then 10 Rules, like this:
Rule
When all conditions are valid
self.MyDigit = 0
-----Animate [your zero sequence]
Rule
When all conditions are valid
self.MyDigit = 1
-----Animate [your one sequence]
etc...
However, this technique is very processor intensive!!! You must test it on an older devices!!!
Actually , a better way would be something like this:
A global boolean attribute called something like 'pleaseUpdateScoreNow'
And instead of the constrain, use a Rule like this:
Rule
when all conditions are valid:
game.pleaseUpdateScoreNow = true
-----Change Attribute: game.pleaseUpdateScoreNow To: false
-----Change Attribute: self.myDigit To: floor(( game.currentScore % self.divisor )/( self.divisor /10))
Then, whenever something affects the score, change game.pleaseUpdateScoreNow to true.
Thanks!
nik