Day 7 - Events v. Polling
The following things have changed since Day 6:
- The different scenes are now in their own files.
- There are a lot of comments.
- There is only one canvas that is shared between the scenes.
- As a result, there is no longer any need for the html templates. This significantly reduces the boilerplate in the code.
- The main game content has been moved into the run state where it belongs.
- The game logic and game rendering in each scene have been appropriate split between an update() and render() method.
The result of today's code is a simple game where the user uses the WASD keys to move their blue square to remove "bad" red squares. You can find the final code here. A cleaner version of the code can be found here.