Pac-Man maze
#7
(08-31-2025, 11:36 AM)Kurt Kuzba Wrote: You can improve the look of it by a higher resolution to your map. But then, you have the track space issue, where moving inside the map has to be limited to specific map spaces. So, for instance, where you have X for a wall and a space for an open area, you could also have another character to designate a motion track, within the open areas. This will reduce the code required to track the movement to the space, since it can only move to a track space. Testing for walls and the like becomes a non-problem.

I don't get the difference between a "space" and a "track space".  You should be able to move to any adjacent space.

There are only four possible directions to move.  The key value will tell you which of those directions the player is trying to move. On every attempted move, just test whether the adjacent cell in that direction is a block or a space. If it is a space, then move. If it is a block, then don't move.
Reply


Messages In This Thread
Pac-Man maze - by Jules Marchildon - 08-30-2025, 03:28 AM
RE: Pac-Man maze - by Stuart McLachlan - 08-30-2025, 04:15 AM
RE: Pac-Man maze - by Jules Marchildon - 08-30-2025, 11:07 AM
RE: Pac-Man maze - by Kurt Kuzba - 08-30-2025, 01:30 PM
RE: Pac-Man maze - by Jules Marchildon - 08-30-2025, 10:18 PM
RE: Pac-Man maze - by Kurt Kuzba - 08-31-2025, 11:36 AM
RE: Pac-Man maze - by Stuart McLachlan - 08-31-2025, 11:46 AM
RE: Pac-Man maze - by Kurt Kuzba - 09-01-2025, 11:33 AM
RE: Pac-Man maze - by Jules Marchildon - 08-31-2025, 01:24 PM
RE: Pac-Man maze - by Jules Marchildon - 09-01-2025, 11:01 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)