Ghosts can get stuck if there is an impassable adjacent tile in their current direction #1

Closed
opened 2019-12-27 05:21:08 -07:00 by mlow · 0 comments
Owner

If a ghost's direction is suddenly reversed such that they're facing an impassible adjacent tile (such a case can occur when eating a power pellet), they get stuck. This is due to the path finding code requiring an empty space in front of the ghost in order to search for a valid next direction.

A simple solution would be to make use of the canMove property in MovableEntity. If it's ever false on a ghost, the ghost is trying to move in an invalid direction. In such case, we should force their currentDirection to a new, valid direction.

If a ghost's direction is suddenly reversed such that they're facing an impassible adjacent tile (such a case can occur when eating a power pellet), they get stuck. This is due to the path finding code requiring an empty space in front of the ghost in order to search for a valid next direction. A simple solution would be to make use of the canMove property in MovableEntity. If it's ever false on a ghost, the ghost is trying to move in an invalid direction. In such case, we should force their currentDirection to a new, valid direction.
mlow closed this issue 2019-12-27 05:55:52 -07:00
Sign in to join this conversation.
No Label
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: mlow/pac-dude#1
No description provided.