Skip to content

Fix #40: Prevent ghost overlap using future position prediction - #43

Open
ksaini-web wants to merge 2 commits into
dishu4u:mainfrom
ksaini-web:fix-ghost-overlap
Open

Fix #40: Prevent ghost overlap using future position prediction#43
ksaini-web wants to merge 2 commits into
dishu4u:mainfrom
ksaini-web:fix-ghost-overlap

Conversation

@ksaini-web

Copy link
Copy Markdown

Fix #40 - Ghost Overlap Issue

Changes Made

  • Added future-position prediction for ghosts.
  • Added ghost-to-ghost collision detection before movement.
  • Prevented ghosts from moving into occupied future positions.
  • Added direction redirection when overlap is detected.
  • Optimized collision checks using direct coordinate comparison.

Testing

  • Tested ghost movement behavior.
  • Tested wall collision behavior.
  • Tested Pac-Man collision behavior.
  • Verified reduced ghost overlap during gameplay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ghosts Can Overlap and Share the Same Path Due to Missing Ghost-to-Ghost Collision Handling

1 participant