How to create a flickering effect over an actor?

I´m trying to make my actor to flicker after picking up an item. Using timers to switch its green color attribute on and off I have managed it to flicker, but when I try to embed these behaviors into the rule "pick up the item and flicker", nothing happens. I´m currently setting the rule to: when actor overlaps or collides with "item", trigger two timers: the first sets the actor´s green attribute to 0 every 0.25 seconds. The second one sets the actor´s green attribute to 1 every 0.5 seconds.
Any suggestions?

Thanks a lot!

Best Answers

  • PixelPunPixelPun Posts: 324
    Accepted Answer
    I found an easy way to do flicker is just add another image that is the color you want and do a quick animation. I am not sure if this takes up more processing power... but it is much simpler (to me) to do it this way.
  • RPRP Posts: 1,990
    Accepted Answer
    Even easier, blink really fast.

    Seriously though, there are a few ways. Are you setting those rules to the actor in the inspector? or the game?

    PixelPun's suggestion is just fine and should not tax the system as long is there is not a lot of actors flickering (amongst other things).

Answers

  • applucinateapplucinate Member Posts: 5
    I´m setting the rules to the actor in the inspector...
  • CORE GameCORE Game Member, PRO Posts: 280
    sorry to participate a bit late, but the idea of having a seperate animation is great you can have a flicker effect by having 2 frames (the image you want + an empty (transparent) image). this way the actor will have a perfect flickering animation.

  • CodeMonsterCodeMonster ACT, AustraliaMember Posts: 1,078
    Even easier.

    Create an Boolean attribute called "flicker" leave it unticked (false)
    Say I want to make my character flicker for 5 seconds.

    Create a rule
    If actor collides with what ever u want then inside the do section
    Create a timer

    [Timer, for 5 seconds "run to completion"

    And inside this timer make another timer.

    [Timer every 0.1 seconds "run to completion"
    Change attribute (flicker+1)%6


    Then create another rule in your actor
    If attribute flicker = 0
    Then change attribute self colour alpha to 1

    Otherwise
    Change attribute self colour alpha to 0


    This way for 5 seconds your main actor will flicker when colliding with whatever you want.
  • SocksSocks London, UK.Member Posts: 12,822
    There are probably dozens of ways to make something flicker, I'd probably use something like this:

    Timer, every 0.1 seconds:
    Change alpha to 1-apha
Sign In or Register to comment.