Log In  

Hey all!

I'm working on a platformer right now and I've been kicking around the idea of custom masks. Essentially, I want to draw a map, and a map on top of that; a circle would then reveal (punch a hole through) the map that was drawn first through the foreground map.

This effect can be done through a simple clip() call between drawing both maps, but that only gives me a rectangle (and only one at that). I'd like that effect, but with a circular shape (or an arbitrary shape ideally).

A solution I've been messing with is saving the background map to memory (at the sprite data or general purpose address), then drawing the foreground map normally with map(). The game would then get the pixels within the shape, get the corresponding data from memory that would match the pixel location, and draw the correct pixels on top of the map, which would look like a "hole" punched through the map.

Thing is: I'm shit at memory stuff.

So, while I read through how memory works and how I can read would-be pixels from a memory address and draw them individually while keeping 60 fps sigh I would much appreciate any help with this. If you think my idea won't work, please let me know; if you have a better idea, PLEASE let me know; if you've done this before, I would be eternally grateful for the help.

That's all for now, I guess I will keep posting as I slowly work my way through this?

Thanks for the help,


- Gabe

P#86970 2021-01-30 17:38

I also have a couple ideas about connecting two parallel worlds, so curious to see your game!

P#86999 2021-01-31 04:55

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2023-05-30 10:38:22 | 0.005s | Q:10