-
Use nodemon to auto reload the server in development
npm install -g nodemon nodemon app
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 */
}
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 */
}
- Collision
- asteroid
- ship
- bullet
- rocket
- mine
- drone
- turret
- Collision
- asteroid
- ship
- drone
- turret
- Collision
- asteroid
- ship
- drone
- turret
- black holes
- white holes
- explosions
- asteroid
- ship
- bullet
- rocket
- mine
- drone
- 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