How can I make my Actor Blink?

JoshKahaneJoshKahane Member Posts: 470
edited November -1 in Working with GS (Mac)
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.

Comments

  • EastboundEastbound Member, BASIC Posts: 1,074
    In a timer:
    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.
  • JoshKahaneJoshKahane Member Posts: 470
    Thanks Eastbound (again). Got it working.
  • rebumprebump Member Posts: 1,058
    `
    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.
  • JoshKahaneJoshKahane Member Posts: 470
    Ok cool thanks Rebump. I guess I shall have to try a few different methods see what squeezes out the best performance.
Sign In or Register to comment.