i would like to change between 3 hotdogs one full one half and one small but i don't know how to change the image when you click on it
When Touch is Pressed change attribute game.imageNumber (integer) to mod(game.imageNumber+1,2). This will cycle between the values 0, 1, and 2.
Constrain attribute self.Image to game.imageNumber.
Be sure to name your three images 0.png, 1.png, and 2.png.
Building upon what tatiang wrote:
Let’s say that your images are named hotdog0.png, hotdog1.png and hotdog2.png
replace: mod(game.imageNumber+1,2) with: “hotdog”..mod(game.imageNumber+1,2).
Doing it this way will allow you to add ketchup too :P
Comments
When Touch is Pressed change attribute game.imageNumber (integer) to mod(game.imageNumber+1,2). This will cycle between the values 0, 1, and 2.
Constrain attribute self.Image to game.imageNumber.
Be sure to name your three images 0.png, 1.png, and 2.png.
Building upon what tatiang wrote:
Let’s say that your images are named hotdog0.png, hotdog1.png and hotdog2.png
replace:
mod(game.imageNumber+1,2)
with:
“hotdog”..mod(game.imageNumber+1,2).
Doing it this way will allow you to add ketchup too :P