Log In  

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!

P#13272 2015-08-29 15:43 ( Edited 2015-08-30 02:36)

"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.

P#13278 2015-08-29 18:01 ( Edited 2015-08-29 22:02)

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.

P#13289 2015-08-29 22:36 ( Edited 2015-08-30 02:36)

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-29 14:59:31 | 0.012s | Q:17