Skip to content

Conversation

@JuanFelipeLedesma
Copy link

I implemented the tunneling effect, allowing Pac-Man to jump from the left side of the screen to the right, and vice versa, just like in the original game. This occurs when he "exits" through the doorways on either side of the level.

@JuanFelipeLedesma
Copy link
Author

Summary

This pull request addresses two main issues in the Pac-Man game:

  1. Map Alignment Issue: The map had an unwanted space of approximately 1 cm on the right side. This has been fixed by dynamically setting the canvas size to match the map dimensions exactly. The canvas now aligns perfectly with the last block on the right, as it does on the left.

  2. Pac-Man Tunneling Implementation: Implemented the tunneling feature for Pac-Man. When Pac-Man exits the map on the right, he re-enters from the left, and vice versa. This improves the gameplay experience by allowing seamless movement across the edges of the map.

Changes Made

  1. Canvas Size Adjustment:

    • Dynamically set the canvas.width and canvas.height based on the map dimensions to ensure there is no extra space on the right side of the map.
  2. Pac-Man Tunneling:

    • Added logic in the Pacman class to handle tunneling, allowing Pac-Man to appear on the opposite side of the map when exiting the screen.

Testing

  • Verified that the map now aligns correctly with no extra space on the right side.
  • Tested the tunneling feature to ensure Pac-Man reappears on the opposite side when exiting the map boundaries.

Additional Information

These changes improve the overall gameplay experience and ensure that the map layout is consistent and visually appealing.

Please review the changes and merge them into the main branch.

Thank you!

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.

1 participant