making individual life "hearts" blink
shylevari
Member Posts: 16
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
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.
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
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?
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.