Hi Guys,
I’m just wondering what the best way of tackling a problem would be. In my game, Stay Alive, you fly through space that is littered with rocks. When you shoot the rocks, they explode. Here’re the two options that I can think of:
-
Have a rock sprite sheet (not animated, it’s so I can display a random frame so the rocks are varied) and an explosion spritesheet. When the rock is destroyed, I create a new animation of an explosion and place it where the rock was.
-
Have a single sprite sheet. The first set of frames will be rocks and the rest with be the explosion animation. I then would simply play the animation at the correct frame when the rock explodes.
My confusion is that with option 2, the sprite sheet would be bigger. Would printing, say, 50 rocks to the screen with a larger sprite sheet effect the performance? Or is it only loaded into memory once?
Currently I’m using option 1, and it can get slow when a lot of rocks explode at the same time. I thought it would be faster with option 2, where I don’t need to create any new objects.
Thanks! [import]uid: 35072 topic_id: 21625 reply_id: 321625[/import]