GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

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

StrobanikStrobanik Posts: 77Member
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 Posts: 3,206Member
    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 Posts: 77Member
    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
This discussion has been closed.