How can I make my Actor Blink?
JoshKahane
Member Posts: 470
Hi
I want my actor to blink for 2 seconds after an attribute has been true for 4 seconds. Acting as warning the power up is running out. I looked at the wiki but it didn't really make sense, so any help would be appreciated, thanks.
Josh.
I want my actor to blink for 2 seconds after an attribute has been true for 4 seconds. Acting as warning the power up is running out. I looked at the wiki but it didn't really make sense, so any help would be appreciated, thanks.
Josh.
Comments
After 4 seconds, set boolean blink to true.
Then nest a timer in a timer:
For 2 seconds, and if blink is true;
Every .1 seconds;
if visible is true, set it to false. If it is false, set it to true.
game.PowerUpTime = 6
if game.PowerUpXX is true
for game.PowerUpTime seconds
after (game.PowerUpTime - 2) seconds
for each 0.1 seconds
self.Color.Alpha = (self.Color.Alpha+1)%2 (to blink)
-or-
self.Color.Alpha = self.Color.Alpha - 0.05 (to fade out)
.
.
.
`
You could make the power-up blink time (the "2" above) into a game attribute too.