SHARE
TWEET

Untitled

a guest Jul 21st, 2019 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const Net = require("./net");
  2. const Player = require("./player");
  3. const Zone = require("./zone");
  4.  
  5. const TICK_SPEED = 500;
  6.  
  7. Net.onAccept = c => {
  8.     Player.makePlayer(c);
  9. };
  10.  
  11. Net.on("MOVE_PLAYER", (p, payload) => {
  12.     p.move(payload.x, payload.y);
  13. });
  14.  
  15. Net.init(18167);
  16.  
  17. setInterval(() => {
  18.     Net.read();
  19.     Zone.main.update();
  20.     Net.write();
  21.  
  22. }, TICK_SPEED);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top