PICO-8: Map-Based Grid Movement
Map-Based Grid Movement
This cart demonstrates simple map-based grid movement. It is heavily commented so you can pull apart how this is being achieved.
Notes: Sprites that you want to be blocking tiles (meaning the player can't walk through them), should have the first sprite flag turned on.
The basic idea is that when the player tries to move, we store the coordinates of where they are trying to go. Then we check those new coordinates to see if the map tile in that spot has a sprite flag of 1 or not. If it does, we just ignore the player's attempt at moving. But if it doesn't, we change the player's location to the new coordinates and play a footstep sound.
Status | In development |
Platforms | HTML5 |
Rating | Rated 5.0 out of 5 stars (1 total ratings) |
Author | MBoffin (Dylan Bennett) |
Genre | Educational |
Made with | PICO-8 |
Tags | PICO-8, sourcecode |
Download
Install instructions
Save this file to your PICO-8 carts folder. Then load it by typing load grid_movement
in the command line mode of PICO-8.