Skip to content

🐛 [Bug]: Broken "Restart Game" Functionality on Game Over in Snake game #500

@siri-004

Description

@siri-004

📝 Description

When the Classic Snake Game reaches a GAME OVER!! state, neither of the "Restart Game" buttons functions correctly:

  1. The Canvas Restart Button: Does nothing but clear the game-over text overlay; it fails to actually re-initialize or start the game loop.
  2. The Bottom Modal Restart Button: Unexpectedly closes the game entirely and routes the user back to the home page dashboard.

🔄 Steps to Reproduce

  1. Launch the Snake Game and play until you trigger a GAME OVER!! screen.
  2. Test Button 1: Click the green Restart Game button inside the gray canvas.
    • Observe: The "GAME OVER!!" text disappears, but the game is frozen and does not start.
  3. Test Button 2: Trigger a Game Over again, then click the green Restart Game button below the canvas.
    • Observe: The modal closes and routes you back to the project home page.

🎯 Expected Behavior

Both buttons should reset the game state (Score = 0, reset snake coordinates, spawn new food) and automatically restart the game loop within the canvas, keeping the user inside the modal.

❌ Actual Behavior / Error Logs

Screen.Recording.2026-05-20.195128.mp4

💻 Environment

  • OS: Windows
  • Browser: Chrome

  • I am a registered GSSoC 2026 contributor.
  • I want to be assigned to fix this issue.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions