When pressed change image and when pressed change image back

henduhendu Member Posts: 8
edited January 2012 in Working with GS (Mac)
Hello

I was wondering guys if you know how to do the action what is in the title. "When pressed change image and when pressed change image back"

Comments

  • ChobbifaceChobbiface PRO Posts: 491
    edited January 2012
    Hi hendu. First make a game real attribute e.g. called imageswitch (or whatever you want).

    Next, in your pressed actor, create a rule: when touch is pressed > change attribute "game.imageswitch" to "(game.imageswitch+1)%2" (without the quotes). This will make it flip between 0 and 1 states each time its pressed.

    Now in the actor that changes images, create a rule: when game.imageswitch = 1 change image (to whatever you want). In otherwise section of rule put change image (back to original image).

    Hope that helps
  • henduhendu Member Posts: 8
    Hi. Just done this and failed could you do me a quick demo please. (This will be my late christmas present from you ) lol
  • ChobbifaceChobbiface PRO Posts: 491
    Sure, give me a sec and pm me your email
Sign In or Register to comment.