Hi, I'm still learning about Pico-8.
Given that there is ONE map (count-em, one!), if a game wants to give the impression of a bigger world, it's going to have to resort to some old school techniques, yes?
A lot like how Mario on the NES was done by making levels out of "chunks" of tiles, eg. one chunk is a set of stairs with a gap in the middle, another is 2 platforms above each other, etc. Thus the level data can just be a serialised list of chunk indexes.
I ask because, for fun, I want to try making "de-makes" of classic games. One might be "Another World". I was coming up with a level storage format which might just be a series of types of shapes, or points, and draw the polygons to create a 2D image, much like the original did, but this would have to be plotted out once, and then I'd have to use old school method of; every frame, capturing the small screen area behind the player, drawing the player, then erasing the player with the stored screen area, apply the movement, and repeat. To avoid re-drawing the background every frame because it might be computationally expensive.
Am I asking too much of Pico? Does this sound like too big a task for what it's meant for?
Not at all!
Simply "layer" the levels!
For a level that fills the screen, you'd need the level to be 16 tiles high (or, if you're really pushing it, just do 15 tiles, and move the camera down 4 pixels.)
1.Put the first level on top, then place the corresponding levels below the last (3 is under 2, 2 is under 1, etc.).
2.Add a bit of code that says "If it's Level 2, then set the camera to that area".
Here's some actual code:
if (level==2) then --level 2 camera_y = 128 camera_x = 0 elseif (level==3) then --level 3 camera_y = 256 camera_x = 0 else --level 1/failsafe camera_y = 0 camera_x = 0 level = 1 end
Thanks for your reply. Well by those calculations, I have a total of 16 screens, which isn't going to be enough.
Also building tile based backgrounds seems wasteful for the polygonal art style of Another World as well, so it still seems worth pursuing. I have created a new thread (since it's really a separate question).
Take a look at how Kid Radd works. https://www.lexaloffle.com/bbs/?tid=2678 I've got the "chunks" of tiles thing going, it copy-pastes the active parts of the map into the bottom of the shared bank to do both rendering and collisions easily without having to handle messy chunk borders.
Ah yes Skyrunner64, that's true. 32 wouldn't be enough though, but I might be asking too much of Pico, maybe...
JTE wow, that's impressive. You generate your tile chunks and paste them into the background data so you can have smooth scrolling... thanks for this.
This is how we make games bigger than the map area.
[Please log in to post a comment]