benz2012 / cat-meow-side

A basic multiplayer game of war, with cats.
http://cats.benzenker.me/
ISC License
1 stars 0 forks source link

Battle Mechanics #4

Closed benz2012 closed 7 years ago

benz2012 commented 7 years ago

perfectly functional with d45a7805e48a71321ec6f5c4adf3d3abc535d7f4 but I need to add some notification to the user that they died and allow the to re-enter play

benz2012 commented 7 years ago

my thought process:

Position

  1. Local: Fire weapon based on angle and position of local player
  2. Firebase: Send weapon initial location & angle
  3. Local: Receive weapon initial location and angle from other users
  4. Local: Render each weapon fire to map

Collision

  1. Local: Detect if a local users' weapon collides with an opponent cat as rendered on their local map
  2. Firebase: Send damage subtraction to receiving user, as a firebase transaction operation

Health

  1. Local: Receive health updates on all cats
  2. Local: Update the health for any opponent cats
  3. Local: Update players own health
  4. Local: If health falls below zero for any cat, kill player sprite
  5. Local: Remove cat from map and weapon from existing after death
  6. Local: If local player health falls below zero, launch modal You died!
benz2012 commented 7 years ago

Closed with PR #30