Skip to content

Instantly share code, notes, and snippets.

@MikeShi42
Created August 13, 2018 17:45
Show Gist options
  • Save MikeShi42/86db6dfd24af37cb7d2ca9bcb7a9c2f5 to your computer and use it in GitHub Desktop.
Save MikeShi42/86db6dfd24af37cb7d2ca9bcb7a9c2f5 to your computer and use it in GitHub Desktop.
let remoteGame = null;
let localGame = null;
// Wait till the browser is ready to render the game (avoids glitches)
window.requestAnimationFrame(function () {
const socket = io.connect(window.location.origin);
remoteGame = new GameManager(socket, true, 4, KeyboardInputManager, HTMLActuator, LocalStorageManager);
localGame = new GameManager(socket, false, 4, KeyboardInputManager, HTMLActuator, LocalStorageManager);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment