Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

PICO-8: Map Screens

A heavily-commented cart showing how to transition to different map screens. · By MBoffin (Dylan Bennett)

A flaw with this + pixel based movement (and a fix)

A topic by conniehedgehog created 38 days ago Views: 20
Viewing posts 1 to 1
(1 edit)

title! if you use this with pixel based movement, it becomes somewhat inconsistent with how far on the next map your player needs to be, since the value is rounded down.

if you're going right or down, your player has to be all the way on the next map to trigger the camera to move. but if you're going left or up, the camera moves the second any of your player is on the next map.

i personally fixed it by changing the "mx=flr(p.x/16)*16" (and the y version) in update_map() to "mx=flr((p.x+p.w)/8/16)*16". /8 because pixel movement's x and y don't line up with the grid and the p.w (p.h for the y version) to fix this issue. it's still a little off, but i'm planning on hiding it with a smooth transition animation.