Pixel Movement with Map Collision

This cart demonstrates how to have simple pixel movement that can use the map to block 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 first check the new location they are trying to move to in both the left/right and up/down directions. If that position has a map tile with a sprite flag of 1 under it, we ignore player movement in that direction.

Comments
Welcome to zddgame comments! Please keep conversations courteous and on-topic. To fosterproductive and respectful conversations, you may see comments from our Community Managers.
Sign up to post
Sort by
Show More Comments

  

Copyright 2023-2025 - www.zddgame.com All Rights Reserved