Log In  

Hello to anyone that sees this. I'm in the middle of working on a Pico 8 game, and it's turning out great so far, however I'm running low on graphics space and I need the whole map for the levels so I can't use the second half of the graphics space. If there's a way around this, perhaps a poke() function that I'm not aware of, or another method, and if someone could tell me that would be great! Thanks!

P#110655 2022-04-21 16:08

There's a couple things you can do. The memory past 0x8000 is available for sticking things into, and the spritesheet can be overwritten at any time, so one solution is to fill the upper memory with sprites and swap the spritesheet with a section of that whenever needed. However, to do that you'd need to get the sprites into upper memory from somewhere. For that you can store the sprites in the code and just stick them in upper memory at the start. Another way, though, is to store them in another cartridge and load back and forth. If any of those sound like they'd work for your game, look at the memset() function, the load() function and the stat() function if you want to use multiple cartridges, or search for compression methods if you want to unload sprites into memory from code.

Beyond that, there's also the option of manually drawing graphics from code. For that you can either make functions that draw one image in a given spot or make a generic drawing function that draws the contents of a string or table. For that method, you could use just pset(), though combining it with rectfill(),line(),circ(), etc. helps too. Just keep in mind that it is slower to draw things manually.

P#110657 2022-04-21 16:23

Extra spritesheets: https://www.lexaloffle.com/bbs/?tid=45769

Other techniques can be found on the bbs (like drawing engines based on shapes, compression code, one specialized for side scroller backgrounds). There are also custom map tools that are interesting!

P#110665 2022-04-21 17:56

That's a lot of options, I'll have to experiment with all of them but the memory address 0x8000 seems the most promising for my game as I could add more game object sprites as well as background elements. Thanks a lot @kimiyoribaka and @merwok!

P#110671 2022-04-21 19:11

[Please log in to post a comment]