GithubHelp home page GithubHelp logo

asteroids's Introduction

Asteroids

Tips

  • Use nodemon to auto reload the server in development

      npm install -g nodemon
      nodemon app
    

TODO

Monitor

Server -> global frame state:

{
  "players":[{
    "color":"red",
    "name": "Red",
    "x": 0,
    "y": 0,
    "angle": 0,
    "score": 0,
    "health": 0,
    "shield": {
      value: 0,
      type: 'repulsor|force|random'
    },
    "type": "fast|fat"
  }],
  "asteroids":[
    0,0,0, /* x, y, size */
    0,0,0, /* x, y, size */
    0,0,0, /* x, y, size */
  ],
  "bullets":[
    0, 0, /* x, y */
    0, 0, /* x, y */
    0, 0, /* x, y */
  ],
  "rockets": [
    0, 0, 0, /* x, y, angle */
    0, 0, 0, /* x, y, angle */
    0, 0, 0, /* x, y, angle */
  ],
  "mines": [
    0, 0, /* x, y */
    0, 0, /* x, y */
    0, 0, /* x, y */
  ],
  "drones": [
    0, 0, 0, /* x, y, angle */
    0, 0, 0, /* x, y, angle */
    0, 0, 0, /* x, y, angle */
  ],
  "turrets": [
    0, 0, 0, 0, /* x, y, angle, type(0=shield, 1=bullet) */
    0, 0, 0, 0, /* x, y, angle, type(0=shield, 1=bullet) */
    0, 0, 0, 0, /* x, y, angle, type(0=shield, 1=bullet) */
  ],
  "blackhole": [
    0, 0, 0, /* x, y, size */
  ],
  "whitehole": [
    0, 0, 0, /* x, y, size */
  ],
  "explosions": [
    0, 0, 0, /* x, y, size */
  ]
  "shake": 0 /* amount of shake 0-10 */
}

Controller

Setup message -> server:

{
    "name": "Red",
    "color": "red",
    "shiptype": "fast|fat"
}

User input message -> server:

{
    "buttons": [1|0, 1|0, 1|0, 1|0, 1|0, 1|0, 1|0, 1|0, 1|0], /* up, right, left, down, fire primary, fire secondary, shield, next primary weapon, prev primary weapon  */
}

Server

Collision

Explosions

Ship

  • Collision
    • asteroid
    • ship
    • bullet
    • rocket
    • mine
    • drone
    • turret

Rocket

  • Collision
    • asteroid
    • ship
    • drone
    • turret

Bullet

  • Collision
    • asteroid
    • ship
    • drone
    • turret

Gravity generators

  • black holes
  • white holes
  • explosions

Gravity targets

  • asteroid
  • ship
  • bullet
  • rocket
  • mine
  • drone
  • turret

AI players

Drone AI

Turret

Sticks to the closest asteroid. Can aim ~30° and rotates with the asteroid. Is destroyed with the asteroid. Asteroids can have both turrets and shields.

  • Targets
    • ships
    • turrets
    • drones

asteroids's People

Contributors

aguldstrand avatar oscarjohansson avatar hektorw avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar  avatar oscar johansson avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.