Skip to content

Instantly share code, notes, and snippets.

@Srushtika
Created June 9, 2020 21:01
Show Gist options
  • Save Srushtika/43651d7fba2ade4880c678bebc5d7e6d to your computer and use it in GitHub Desktop.
Save Srushtika/43651d7fba2ade4880c678bebc5d7e6d to your computer and use it in GitHub Desktop.
Code snippet 23 - For multiplayer space invaders article
let gameRoom;
let deadPlayerCh;
let myClientId;
let myChannel;
let gameOn = false;
let players = {};
let totalPlayers = 0;
let latestShipPosition;
let bulletThatShotMe;
let bulletThatShotSomeone;
let bulletOutOfBounds = "";
let amIalive = false;
let game;
const BASE_SERVER_URL = "http://localhost:5000";
const myNickname = localStorage.getItem("nickname");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment