UoB-COMSM0110 / 2024-group-3

0 stars 1 forks source link

Bug fix: Garbage collect data after game over #38

Open chriskerrc opened 3 months ago

chriskerrc commented 3 months ago

After multiple game instances have been played through, and the user has exited to the main menu by pressing ESC each time, the game overall slows down. Exiting and restarting the game is a workaround. Ensure that data is deleted and does not persist in the background.

chriskerrc commented 3 months ago

On game restart, sometimes you collide with objects from previous instances of the game, because they haven't been cleared from the metadata.

chriskerrc commented 3 months ago

When the snake dies, need a cleanup/reset method to destroy unused data/objects. Currently, data from previous game sessions are persisting. Do this within the existing GameOver() method in Main.pde

chriskerrc commented 3 months ago

Ensure that every object that's being pointed to in GameScreen is torn down.