09-01-2025, 11:33 AM
(08-31-2025, 11:46 AM)Stuart McLachlan Wrote: 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.
If you increase the resolution of the map, to use smaller tiles, then your track space will be surrounded by open spaces. Movement into those spaces will cause a collision with a wall. Since the Pacman model does not allow real 4 directional movement, and is constrained by a system of walls, you would need to test for collisions with walls.
Assuming you increased the resolution of your map, of course. One advantage is that turning around in the space available happens more quickly, since the movement to the next track space is less than the movement to the next game space. Just more complications you can add, if you want to.
(08-31-2025, 11:46 AM)Stuart McLachlan Wrote: 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.
(08-31-2025, 11:46 AM)Stuart McLachlan Wrote: 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.