A web based clone of Asteroids (1979) built with pixi.js for graphics, howler.js for sound, detect-collisions for Collision Detection and nopun-ecs for logic.
I'm not an expert on game development, but I wanted to provide an example of how to use nopun-ecs for an actual playable game. I chose Asteroids as a basis, because I could easily model it in my head.
The game works, but I'm pretty sure that the code offers lots of room for improvement that anybody with more experience in game development will notice. If so, please let me know! I'm always eager to learn :)
Nevertheless, this example demonstrates how to use nopun-ecs to model a game with a decisive set of features:
- Multiple different entities
- A minimal amount of 2D Physics
- Collision Detection
- Graphics
- Sound & Music
The entire code base is commented for you to go ahead, browse the source files and follow along how this was done.
- Clone the nopun-ecs github repository @ https://github.com/grebaldi/nopun-ecs.git
- Install the dependencies via
yarn
cd
intoexamples/ultimate-space-rock-eliminator-9000/
- Install those dependencies via
yarn
- Run
yarn start
Here's a shell snippet that should to the trick:
git clone https://github.com/grebaldi/nopun-ecs.git
cd nopun-ecs/
yarn
cd examples/ultimate-space-rock-eliminator-9000/
yarn
yarn start