Surface Object Data Restoration
I'm working on a videogame where the player is stuck on a black/white background - depending on the colour of the player's ship he is either trapped between the black background spaces or the white, but he can destroy and flip between either. A better explanation and practical example can be seen here, using basic blank backgrounds [and the 'paste as backdrop' command].
I'm working on an updated engine test, experimenting with more detailed backgrounds for both black and white worlds. For this I'm using two Surface objects overlayed on top of each other, Black on top of White for starters. Now what I've managed at the moment is to enable the player to destroy segments of the black Surface object [using a transparent-color rectangle fill], revealing the White underneath. That's all well and good. What I'd like to do now is to allow the player to fill the 'deleted' portion back in to restore the Surface object to how it was beforehand - the player should be able to wipe out, say, a large circle of the surface and then restore it piece by piece.
How would I go about a 'fill restored segment' event?
Re: Surface Object Data Restoration
Hello,
What you're trying to accomplish might be easily doable when both Surfaces are fully opaque. In that case, you can use their alpha channels. Just fill it black where you want to erase something, and fill it white again to make the stars reappear.
I think I made an example of how to draw to an alpha channel in the official Surface object examples. Go grab them ;)
Re: Surface Object Data Restoration
Looki I could almost kiss you, that idea worked out perfectly. Here's the test build so far. Thanks again for the help!
Re: Surface Object Data Restoration
No problem - Since you're using rectangles you can simply draw to the alpha channel. To draw ellipses etc. you'd have to temporarily copy the alpha channel to another image and modify it there, which is a bit complicated :blush: That's an interesting looking game concept, I can imagine where it's going :) Cool to see my extension used in a creative way.