An open API service indexing awesome lists of open source software.

https://github.com/bobgeis/js-space-rocks

Asteroids in javascript: https://bobgeis.github.io/js-space-rocks/
https://github.com/bobgeis/js-space-rocks

asteroids game immutable javascript react redux

Last synced: 3 months ago
JSON representation

Asteroids in javascript: https://bobgeis.github.io/js-space-rocks/

Awesome Lists containing this project

README

          

# js-space-rocks

This is a learning project made while learning javascript. It's an asteroids clone, because whenever one learns a new language, it's fun to make a game in it, and I happen to like asteroids.

[__Play it here.__](http://bobgeis.github.io/js-space-rocks/)

## Controls

Keyboard:
* LEFT (or A) and RIGHT (or D) rotate the player ship
* UP (or W) accelerates the player ship
* DOWN (or S) reverses
* SPACE fires the disintegrator
* P pauses, ENTER unpauses
* Z activates the Omega 13: "Enough time to undo a single mistake" Note that if charged, you can use this even if your ship is destroyed.
* ENTER starts the game, restarts on destruction (remember to try Z if you can)
* U resets the high score to all zeros

## Objectives

Oh no! Some hooligans are dumping space rocks in to Subspace Locus 1457 again!

Luckily, a dedicated rescue and rock-buster ship is already prepped and on-site. That's you!

* Try to keep Subspace Locus 1457 safe for travelers.
* If any ships get hit by rocks, pick up their lifepods and deliver them to the medbay in the North East quadrant for treatment.
* If you pick up any crystalline minerals from busting rocks, deliver those to the prospector base in the South West quadrant for analysis.
* If you get into a jam, hopefully you have enough charge on your Omega-13 to try again. Good luck!

## Attributions

Background image of Carina Nebula is available [here](https://commons.wikimedia.org/w/index.php?search=carina+nebula&title=Special:Search&go=Go&uselang=en&searchToken=79al97qlirmupg5bpga22jvj2#/media/File:Carina_Nebula.jpg). Credit to [ESO/T. Preibisch](http://www.eso.org/public/images/eso1208a/) used under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/).

All other sprites were made by the programmer.

## Developers

Download or clone this repo onto your local drive, then cd into the folder containing package.json and ```yarn``` or ```npm install```.

* For a hot reloading dev server: ```yarn start``` or ```npm start``` and go to http://localhost:3000 in your browser.
* For the minified bundle: ```yarn prod``` or ```npm run prod``` and then open index.html in your browser.

## Influences

Asteroids and similar games (eg: Escape Velocity, Endless Sky, etc).

Previous practice projects in other languages (eg [Elm](https://github.com/bobgeis/LookOutSpaceRocks), [CoffeeScript](https://github.com/bobgeis/coffeeAsteroids)).

Another implementation of asteroids in React. [link](https://github.com/chriz001/Reacteroids)

Various Redux examples. [link](https://github.com/reactjs/redux/tree/master/examples)

A Redux Immuble TodoMVC example. [link](https://github.com/phacks/redux-todomvc)

A Redux Undo TodoMVC example. [link](https://github.com/omnidan/redux-undo/tree/master/examples/todos-with-undo)

The Elm Graphics.Collage library. [link](https://github.com/evancz/elm-graphics)