danieldesira / TurtleQuest

https://turtle-quest.vercel.app/
Creative Commons Attribution 4.0 International
0 stars 0 forks source link

Further character refactoring #10

Closed danieldesira closed 8 months ago

danieldesira commented 8 months ago
  1. _characters field should have a WeakSet type since objects are removed when references are removed.
  2. The final children class should have two constructors:
  3. A default constructor that assigns the default values.
  4. A constructor that accepts an Options parameter and assigns all field values accordingly.
  5. The readonly keyword can be retained since the fields will still be only assigned once at initialisation and should otherwise be immutable.
danieldesira commented 8 months ago

Point 1 cannot be done because WeakSet is not iterable.

The rest is done but we need to check the issue that has caused NeptuneGrass to disappear from the canvas. Unrelated to this, we also need to check the errors shown in the browser console upon actions like resizing when canvas is hidden and winning the game trying to access the level beyond the last one.

danieldesira commented 8 months ago

Issue with Neptune grass is fixed but the game crashes after clicking Play again and completing the 1st level, now.

danieldesira commented 8 months ago

All issues sorted. Game menu is shown by default now rather than just starting the game, which was going to be done anyway.