# DeepImpact

A musical missile command

## Rules

### Level

Sprites: Background, boss, projectiles

Sound: Music

Text: Title, subtitle


-> Boss slowly rising until the end when it explode

### Pages

* Main menu
* Lobby (no instances, level selection, ready)
* Game (canvas)

### Gameplay

Control one bunker

Multiple turret type
* Slow steady, single fire, medium aim (medium damage)
* Rapid fire, burst, quick aim (small damage)
* Very slow, single shot, low aim (high damage)

Turret aim follow mouse with latency, cooldown between fires


## Tech

Music on client -> Effects (background)
Music on server -> Compute meteor spawn, player state (health), game state, 


### States

Game -> LOBBY, RUNNING, END
Player -> UNKNOW, WAITING, PLAYING

### Messages

#### To server

* login (string)
* logout
* ready (weapon type)
* start (music title)
* fire (angle)
* music (file)

#### To Client

* userlist
* state (game state)
* update (game update)
* music (file)
* play (music title)
* ok (message)
* nok (message)

### Game Update

```
{
   players: [
      {
         "name": string,
         "health": number,
         "weapon": string,
         "angle": number
      }
   ],
   meteors: [
      {
         "x": number,
         "y": number,
         "speed": number,
         "angle": number,
         "health": number
      }
   ],
   bullets: [
      {
         "x": number,
         "y": number,
         "speed": number,
         "angle": number,
         "damage": number
      }
   ]
}
```