making individual life "hearts" blink

I am attempting to a little bit of animation to the health "hearts" bar. Currently the is one heart replicated to 5 times, attached to a "life" integar. When the value changes - the num of hearts is adjusted accordingly.

Is it possible to control each replicated instance individually? I.e. making fade out, pop, etc. ?

Comments

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273

    Unfortunately, no. You'd have to manually drag and place your heart actors on screen to edit their properties. You cannot call or adjust the properties of the replicated actors.

  • shylevarishylevari Member Posts: 16

    Ok thanks. So basically create 5 different actors and attach each one a behavior checking the value of "life"

    Unless maybe there's a way to create a "for" loop in gamesalad? To run one behavior on all the hearts?

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited December 2014

    You can give the heart actor an integer attribute called self.myPosition. Then in the scene, double-click each heart actor and change its self.myPosition value to match it's position (e.g. the first in line is 1, the second is 2, etc.). Set up the rule this way:

    If self.myPosition ≤ game.life
    Change attribute self.color.Alpha to 1
    Else
    Change attribute self.color.Alpha to 0

    Edit: that won't make them blink but will instead just make them visible. In the 'If' portion of the rule, just add your blink timer there.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • Yes! you could do 1. if health = # change image/animate

    = whatever you want you number to be.

Sign In or Register to comment.