Hi all,
I'm having a great time poking around Pico-8, and coming from the NES development world, a lot of the constrained programming makes sense. But my last sticking point is scrolling—I understand how maps work, and I can create a screen-to-screen transition effect by changing the offset into contiguous map data, but I can't figure out how to scroll smoothly 'across' map data. When I attach the camera to the player's position, I travel off the first map and into a weird glitchy void.
Does anyone have a simple example of how to implement scrolling? I've downloaded several example games, but everyone seems to have a different approach, and they are difficult to parse in a fully-functioning game.
Thanks!
"Weird glitchy void" makes it sound like you are not drawing the place the player is moving into. You're not clearing the screen there either, so it is displaying the junk left over from when you moved the camera.
If you are set up to draw whole screens/rooms at once, then you need to draw every screen/room that the camera can see if you are panning across rooms.
Thanks, cheepicus, that was it! I didn't realize I needed to use the 'map' command to pre-buffer the entire map, AND I had forgotten cls() in my _draw routine.
[Please log in to post a comment]