Way to change actor image when spacebar is pressed?
![tannerozzy](http://forums.gamesalad.com/applications/dashboard/design/images/defaulticon.png)
I'm creating an alien conquerers type game and I want to use about a dozen different images as the bullets/lasers. I've played around with it for a little while, but still can't figure it out. Does anyone know how to set it where every time I press spacebar the actor uses a new image?
Thanks for any help!
-Tanner
Thanks for any help!
-Tanner
Comments
when spacebar is pressed +1 to NEWRULE
when NEWRULE is x or x or x
change image to
Rule when space is down
change self.attribute to (self.attribute + 1)%5
NOTE - "5" would allow you to switch between 5 different images so change it to whatever you want.
Name your image files so they are all the same except a number (i.e. image1.png, image2.png, image3.png, etc.)
Then inside the same rule above add this:
change attribute self.image to "image"..self.attribute..".png"
This is what I have for the rule:
http://pix.am/EZwh.png
And this is the full application view:
http://pix.am/bz8z.png
I really do appreciate the feedback. It's great being a part of a reliable and supportive community!