Bethod method for image swapping.
![ShaneS429](http://forums.gamesalad.com/applications/dashboard/design/images/defaulticon.png)
I am working on a game where I have a grid of colored game pieces. When pieces are pressed, they are "destroyed," and after a few seconds, they will come back as a new piece with a random color.
I am struggling to figure what will be less demanding of the devices.
Since my game will be a 8x8 grid of pieces(64 actors total just for the game pieces, not counting the hud and other actors), I definitely want to lower the cpu and memory usage as much as possible.
So far I have a few ideas of how I could do this.
A: When GamePiece is pressed, Change Image to InactiveGamePiece (which is basically just a white see-thru icon), after 'x' seconds, randomize to a new GamePiece.
B: When GamePiece is pressed, Change Attribute Color (R,G,B) to make it white, after 'x' seconds randomize to a new GamePiece Color.
C: Use the Change Attribute - currentImage (I'm just reading about this now from Fire Maple Games' "Animation Controller DEMO"
Any idea of which way would work best considering I will have an entire grid of 60+ of these actors running through all the same rules?
I am struggling to figure what will be less demanding of the devices.
Since my game will be a 8x8 grid of pieces(64 actors total just for the game pieces, not counting the hud and other actors), I definitely want to lower the cpu and memory usage as much as possible.
So far I have a few ideas of how I could do this.
A: When GamePiece is pressed, Change Image to InactiveGamePiece (which is basically just a white see-thru icon), after 'x' seconds, randomize to a new GamePiece.
B: When GamePiece is pressed, Change Attribute Color (R,G,B) to make it white, after 'x' seconds randomize to a new GamePiece Color.
C: Use the Change Attribute - currentImage (I'm just reading about this now from Fire Maple Games' "Animation Controller DEMO"
Any idea of which way would work best considering I will have an entire grid of 60+ of these actors running through all the same rules?
Comments
I basically had a piece random a number from 1-6. 1 = red, 2 = orange, and so on.
Previously I had a rule after rule saying, If Color = 1 - Change Image to RedPiece, Otherwise if Color = 2 - Change Image to OrangePiece.
Now I just have it randomize a color 1-6 and follow it up with a ChangeAttribute - Self.Image to Color..".png" and it eliminates the need for all those rules.
So I guess this topic can be closed but it is good reference for anyone else wanting to change images like I am doing.