- Pick up higher-level problem solving skills.
- Dive deeper into writing functional JavaScript using the better parts of ES2015/ES2016.
- Make a real-time action game from scratch.
- This is a bare-bones implementation of the classic shooting game Space Invaders.
- The player must shoot all the invaders before they reach the player to win.
- The invaders randomly keep shooting and slowly move towards the player.
- Drawing on the canvas, the game loop, and collision detection are all done without any libraries or frameworks.
- This project was written in a functional programming style using ideas borrowed from Clojure and Elm Architecture.
- It's not purely functional because of the limitations of JavaScript and I/O being inheritently impure.
- Instead of deep cloning objects and arrays, one could use a persistent data structure library such as MORI.
Play the game on http://Khaleed.github.io/ShootEmUp
To get dependencies
npm install
Install Webpack globally
npm install webpack-devserver webpack -g
To serve at http://localhost:8080/webpack-dev-server/
npm run watch
To build when NODE_ENV environmental variable is set to production
npm run deploy
I would like to thank the following awesome people:-
- David Hargat for showing me how to make JavaScript games
- Sal Becker for teaching me functional programming
- Diego Berrocal for introducing me to JavaScript ES2015
- Ralph Barton and Pierre-Yves Baccou for helping me with the computer animation physics
- Marijn Haverbeke, the author of Eloquent JavaScript, for helping me refactor to make the game even more functional.
© github.com/Khaleed
ShootEmUp is released under the GPL-3.O License.