Change actor image

easybusyeasybusy Member, PRO Posts: 11
edited November -1 in Working with GS (Mac)
Hallo everyone
this is the problem: I need to change the actor image when it collide with a powerup actor and then return to the previous image when the powerup function terminate.
What can I do?
thank you
easybusy

Comments

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

    When actor overlaps or collides with powerup,

    Timer, change image for 5 seconds (or whatever)

    Open up the otherwise part, and put a change image to the original image there.
  • easybusyeasybusy Member, PRO Posts: 11
    Thank you Braydon_SFX
  • easybusyeasybusy Member, PRO Posts: 11
    I do know why but it does not work. For sure is my fault. Any advice?
    Thank you
  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
    Did it change the image first? Did it not do anything? Did it change but didnt change back?

    Let me know.
  • easybusyeasybusy Member, PRO Posts: 11
    It did not do anything.
  • butterbeanbutterbean Member Posts: 4,315
    Try this: Create an attribute: Powerup and set it to false or 0

    In the power up, when overlaps or collides with "player", and game.powerup is false, change game.powerup to true

    Timer: after 5 seconds: change game.powerup to false

    Then in the player:

    Create a rule: When game.powerup is true: change image to: (what you want here)

    otherwise:

    change image to: normal image
  • easybusyeasybusy Member, PRO Posts: 11
    Dear butterbean
    where have I to create the attribute to set it false, in the game attribute folder or un the actor (in that case powerup) attribute folder?
  • butterbeanbutterbean Member Posts: 4,315
    Create the Game.Powerup Attribute globally, and then create the rule in the power up to detect when it hits the player. (we want globally because we want the player to know when it's true and false)

    ie: When your power up actor overlaps with the player, put the rule in there that changes the power up attribute to true, then after 5 seconds, reset it to false.

    Then in your player, do the change image stuff.
  • easybusyeasybusy Member, PRO Posts: 11
    okay thank you. I will try soon :)
Sign In or Register to comment.