Space Invaders 2-player game! 🚀
public/
- contains all the game files- ⭐
EventController.js
- registers Keyboard events (keydown/keyup) and maps them to game-related functions - ⭐
GameController.js
- handles all display logic and static assets for the game based on the state of aGameModel
- ⭐
GameModel.js
- contains all state for the game, including player/invader/bullet positions and statuses game.html
- static page to load in the above JavaScript to play the gameindex.html
- static landing page that has a button to a new (randomized) game linkstatic/*
- static resources: spritesheet, spritesheet JSON, and all audio files Note: these resources are not mine - they are from a Space Invaders game found on Messenger Instant Games. They are reproduced here for educational purposes only.
- ⭐
app.js
- the Express web server that has one route defined for the game at/play/:id
, whereid
is the unique ID for a roomevents.js
- the WebSockets server to pass event data between clients