GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

How to make an image keep on changing when touched!

Hello,

I am working on an app but I can not figure out how to make an image to keep on changing every time touched. Here is a short video to help. I just want to be able to see the image I selected to take the place of the one up, if that makes sense. So when image is touched a new one will come up and when that one is touch a new one will come up.





I hope this makes sense!

Thanks
Conner

Comments

  • tatiangtatiang Posts: 11,911Member, Sous Chef, PRO, Senior Sous-Chef
    Before you import your images, name them in consecutive order such as ship1.png, ship2.png, ship 3.png, etc.

    Make an integer attribute called game.imageNum and set it to 1.

    Have a rule that says When Touch is Pressed Change attribute game.imageNum to game.imageNum+1

    Then have a behavior to Constrain Attribute self.Image to "ship."..game.imageNum

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • BIG_THINKIN_APPSBIG_THINKIN_APPS Posts: 944Member
    tatiang said:

    Before you import your images, name them in consecutive order such as ship1.png, ship2.png, ship 3.png, etc.

    Make an integer attribute called game.imageNum and set it to 1.

    Have a rule that says When Touch is Pressed Change attribute game.imageNum to game.imageNum+1

    Then have a behavior to Constrain Attribute self.Image to "ship."..game.imageNum

    Hey Thanks,

    I will try to figure this out. Do you know if there is a video on this because they are very helpful to me. Also will this be hard to do with 20+ actors that will do the same on different scenes.
  • tatiangtatiang Posts: 11,911Member, Sous Chef, PRO, Senior Sous-Chef
    edited February 2014
    While a video might be better if you are a visual learner, there isn't anything *more* to it than what I posted above. One attribute, one rule with a single behavior, and one additional behavior.

    There may be videos related to this... custom font, for example, but I recommend just trying what I posted first. The videos may confuse you more since they are more advanced than what you are asking.

    It's not hard at all, even with dozens of actors.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • BIG_THINKIN_APPSBIG_THINKIN_APPS Posts: 944Member
    tatiang said:

    While a video might be better if you are a visual learned, there isn't anything *more* to it than what I posted above. One attribute, one rule with a single behavior, and one additional behavior.

    There may be videos related to this... custom font, for example, but I recommend just trying what I posted first. The videos may confuse you more since they are more advanced than what you are asking.

    It's not hard at all, even with dozens of actors.

    Thanks for that. I just figured it out. Yeah it may take a while to do but it will work.

    Thanks for helping me with this all!!!
  • tatiangtatiang Posts: 11,911Member, Sous Chef, PRO, Senior Sous-Chef
    If you need to add that behavior and rule to a bunch of actors, just put them in a group and then drag the group into the custom behaviors area. That way, in each actor all you have to do is open the actor and drag the group in from custom behaviors.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • BIG_THINKIN_APPSBIG_THINKIN_APPS Posts: 944Member
    I am really not sure how to make the 2 change to 3.
  • BIG_THINKIN_APPSBIG_THINKIN_APPS Posts: 944Member
    I am willing to pay some one to Skype me and show me how to do this step by step.

    I am just not very good with anything besides the very very basics of GameSalad.

    If you could help please tell me as soon as possible.

    I really think that I am messing everything up.... :(
  • Braydon_SFXBraydon_SFX Posts: 8,982Member, Sous Chef, PRO, Bowlboy Sidekick GameSalad Employee
    edited February 2014

    I am willing to pay some one to Skype me and show me how to do this step by step.

    I am just not very good with anything besides the very very basics of GameSalad.

    If you could help please tell me as soon as possible.

    I really think that I am messing everything up.... :(

    EDIT: Removed. Check below. ;)
  • Braydon_SFXBraydon_SFX Posts: 8,982Member, Sous Chef, PRO, Bowlboy Sidekick GameSalad Employee
    ...Eh...What the heck. ;)

    Enjoy.
  • BIG_THINKIN_APPSBIG_THINKIN_APPS Posts: 944Member
    @Braydon_SFX

    I figured out how to do it now! But for some reason after it goes through all the image it makes a white box the same size instead of starting over again. Any ideas!
  • SocksSocks London, UK.Posts: 12,822Member
    edited February 2014

    Thanks @Braydon_SFX for taking the time out of your day to make me a demo project


    In the demo posted by @Braydon_SFX he uses '%10' to cycle/loop through 10 images.
  • BIG_THINKIN_APPSBIG_THINKIN_APPS Posts: 944Member
    Socks said:

    Thanks @Braydon_SFX for taking the time out of your day to make me a demo project


    In the demo posted by @Braydon_SFX he uses '%10' to cycle/loop through 10 images.

    Thanks for that it now goes through them, but still has the white block when going through! If you know what I mean. (:
  • SocksSocks London, UK.Posts: 12,822Member

    Socks said:

    Thanks @Braydon_SFX for taking the time out of your day to make me a demo project


    In the demo posted by @Braydon_SFX he uses '%10' to cycle/loop through 10 images.

    Thanks for that it now goes through them, but still has the white block when going through! If you know what I mean. (:
    Add '+1' to the end of the '%10' equation.

  • BIG_THINKIN_APPSBIG_THINKIN_APPS Posts: 944Member
    Socks said:

    Socks said:

    Thanks @Braydon_SFX for taking the time out of your day to make me a demo project


    In the demo posted by @Braydon_SFX he uses '%10' to cycle/loop through 10 images.

    Thanks for that it now goes through them, but still has the white block when going through! If you know what I mean. (:
    Add '+1' to the end of the '%10' equation.

    Thanks for getting back so fast! It works now!

    I am very grateful for everyone's help on this!!!! (:

    Conner
Sign In or Register to comment.