Log In  

For a game I'm making, I want it to be infinitely generated. For this, I need to know how to efficiently remove all map tiles. Is there any way to quickly do this? The only thing I can think of is setting everything to sprite 000, with mset(). I imagine this would be fairly computer intensive, so how would I do this?

P#116253 2022-08-25 01:39

memset(0x1000,0,0x2000)

The function memset() sets a range of bytes in the raw memory to a specified value. The map data starts at address 0x1000. 0 is the value to set each tile to. 0x2000 is the length of the map data in hexidecimal.

If you're only using half the map so you can use the full sprite page, use this instead:

memset(0x2000, 0, 0x1000)

For more info, you can look at the memory section of the manual or go to this page on the wiki.

P#116255 2022-08-25 02:57

reload() would also do

P#116270 2022-08-25 11:13

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-29 02:19:32 | 0.006s | Q:14