Question about FMG:s custom fonts demo... animations?

StrobanikStrobanik Member Posts: 77
edited November -1 in Tech Support
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

Comments

  • firemaplegamesfiremaplegames Member Posts: 3,211
    Ah yes...I changed the demo to just use images.

    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.
  • StrobanikStrobanik Member Posts: 77
    Cool, thanks for the fast answer. I'm trying to find an easy way to randomize an actors appearance between a lot of different animations. The "name"..blabla..".png" is so damn convenient, and I just hoped there was a beautiful solution with animations too. But I guess I'll just do a lot of rules and randomize an integer, as you suggest.

    Thanks!
    nik
Sign In or Register to comment.