#164461 - crazakp - Mon Nov 03, 2008 8:37 am
I want to make an explosion, which will erase the sprites in the area that the explosion happened in. The area erased is exactly the same shape as the explosion sprite.
Do I need to do this in mode 4 or 5, where I could just replace the pixels with the color of the background? Or is there a way to do this using just sprites?
I can clarify further if need be.
#164464 - strat - Mon Nov 03, 2008 11:40 am
You can use sprites for everything. Basically you'd change the vram so the pixels that are erased by the explosion would be the transparent color.
#164465 - kusma - Mon Nov 03, 2008 11:55 am
I'm not sure I understand exactly what you mean, but it might be that the "OBJ Window" mode of "OBJ Mode" is what you want.
#164466 - gmiller - Mon Nov 03, 2008 1:41 pm
Assuming I understand what you want to do (any sprite in the area of the explosion needs to be "destroyed"). You could have an animation sequence of tiles that you replace for the tiles being used for the sprite image.
The starting tile image for each frame of animation would be used for the sprite image and then at some time sequence you would update the it to the next frame of animation.
So assuming that the tile index of the animation sequence is 10, 20, 30, 40 (all fictitious choices) you would change the tile index in attribute 2 to each of the indexes in sequence at some time interval. the last animation frame would only have a few pixels visibal the rest would be the transparent color (zero offset in the palette) and then make the sprite invisible (non rotational and double sized). Depending on which library you are using this would vary but underneath this is what would be done.
If I did not understand what you were asking please correct me ...
#164577 - crazakp - Sat Nov 08, 2008 12:28 am
I think I'm going to use strat's way. It seems like it's the closest to what I'd like to achieve.
Here's a picture of what I'm describing. I'm sure it'll be a lot clearer.
[Images not permitted - Click here to view it]
The explosion could happen anywhere on any tile. It would be possible to destroy all the tiles. In other words, destructible 2d terrain.
#164580 - DiscoStew - Sat Nov 08, 2008 2:52 am
crazakp wrote: |
I think I'm going to use strat's way. It seems like it's the closest to what I'd like to achieve.
Here's a picture of what I'm describing. I'm sure it'll be a lot clearer.
[Images not permitted - Click here to view it]
The explosion could happen anywhere on any tile. It would be possible to destroy all the tiles. In other words, destructible 2d terrain. |
I took one look at that picture, and memories began flooding back to me. Good ol' QBasic Gorillas.
If that is what you are trying to mimic, then I'd highly recommend not trying to do that with sprites. You *could* do it with Text backgrounds, but that could be requiring a good amount of organizing, as well as directly manipulating each and every tile affected by an explosion, requiring multiple copies for uniqueness.
I would recommend you use a Direct mode for something like this. Keep sprites for the characters, weapons, etc, but the "play area" as the background that you can access directly, pixel by pixel.
_________________
DS - It's all about DiscoStew