change image when touched and then change it again

lanaooolanaooo Member Posts: 5
edited September 2012 in Working with GS (Mac)
I have a scene where I want the image to change when touched. This is a counting game, so I want them to be able to touch once, see one item, hear "one" then touch again, see two of the items, hear "two" and on and on up to ten. I can get it to do it the first time but don't know how to set up the rule to load the next image and sound. I am completely new to this so I might be missing the obvious... Thanks !

Comments

  • Mr HansonMr Hanson Member Posts: 94
    Hello @lanaooo

    I created a template for what you wanted. I didn't know how to explain it to you simply on the forums. If you want i can send it to you, PM me your email.
    Otherwise here is what i got:

    create a game attribute called 'Touch count" and a Boolean attribute called "Can touch" and set it as true.
    Create an actor that covers the whole scene that is sent to back and is invisible. In that actor create a rule that says if touch is released, change "Can touch" to "true."

    Then on your main actor, create a rule that says if touched is press, if game "Can touch" is true, if "touch number" is equal to 1. Then change image and add sound. then change "touch number" to "touch number + 1". Change "can touch" to false.

    Then copy and paste it ten times changing to rule so that touch number is equal to 2 then the next one say 3 and so on.

    You can if you don't want to have so many rules by changing all images to (for example) number2, number3, number4. Then just adjust it to the one rule where it changes image to number"touch number".png. There are other ways to do this i am guessing but this is the way i used.

    Hope this help in some way or get you on the right track.

    All the best

    JonApp
  • lanaooolanaooo Member Posts: 5
    Thanks, I sent you a message. I will try it and see if i can figure it out. I thought about just changing the scene each time but dont think that would give me the effect i am looking for.
  • Mr HansonMr Hanson Member Posts: 94
    Hello @lanaooo

    Sent it. However i will say try not to use different scenes as a by-pass. Most things can be done on the one scene, only because switching between scenes takes time to load.

    Good luck on the rest of the game/app!

    All the best

    JonApp
  • lanaooolanaooo Member Posts: 5
    That is what I was thinking. Thanks so much for your willingness to help.
Sign In or Register to comment.