]> git.eli173.com Git - pong_br/commitdiff
added todo list, other stuff
authorElijah Cohen <eli@eli173.com>
Mon, 13 May 2019 04:39:32 +0000 (23:39 -0500)
committerElijah Cohen <eli@eli173.com>
Mon, 13 May 2019 04:39:32 +0000 (23:39 -0500)
.gitignore
server/TODO.org [new file with mode: 0644]
server/constants.js
server/matchmaker.js
web/main.js

index b5ad404ddde1cfa1d4effbafd2b41229c3dea833..2409f5f6834667f0a01ca017e178d4b3ea634acd 100644 (file)
@@ -40,3 +40,4 @@ server/node_modules/*
 /web/input.js~
 /server/health.js~
 /server/robot.js~
+/server/TODO.org~
diff --git a/server/TODO.org b/server/TODO.org
new file mode 100644 (file)
index 0000000..a4db889
--- /dev/null
@@ -0,0 +1,7 @@
+list of things i should still do:
+- death screens
+- waiting message
+- fix collisions
+- fix oob
+- splash page
+- fiddle with variables to optimize fun
index 390d7f88f531fa7c84068670151d5fa0ec4f99d9..72619d793ba10abca899c4702dd34a73f3e29d26 100644 (file)
@@ -1,15 +1,13 @@
 
 
-var mspf = 100;
 var c = {
     // matchmaker
     WS_PORT: 6789,
     NUM_PLAYERS: 4,
-    MS_PER_FRAME: mspf,
-    FPS: 1000/mspf,
+    FPS: 30,
     WAIT_TIME: 60000, // 1 minute
-    MAX_GAMES: 5, // the most games allowed to go on at once, to be tweaked as needed for purposes
-    ROBO_TIME: 120, // time in seconds before filling out with robots
+    MAX_GAMES: 2, // the most games allowed to go on at once, to be tweaked as needed for purposes
+    ROBO_TIME: 30, // time in seconds before filling out with robots
     // gamestate
     DYING_TIME_IN_FRAMES: 100,
     BOARD_RADIUS: 10,
index ce8134b7acc2d3b7bc621449ec7a2e9d682fd6ce..f8c99c28df3638e6ae3718bdecb8952aeecdc381 100644 (file)
@@ -32,14 +32,14 @@ var manage_incoming = function(ws) {
     if(players.length >= c.NUM_PLAYERS) {
        game = new Game(players.slice(0, c.NUM_PLAYERS));
        health.inc();
-       game.start(c.MS_PER_FRAME);
+       game.start(1000/c.FPS);
        players = players.slice(c.NUM_PLAYERS); // just security in case >n connections at once
        // i think js lack-of-threading makes it impossible for that to happen though
        clearTimeout(timeout);
        timeout = null;
     }
     else if(timeout == null) {
-       setTimeout(robot_adder, c.ROBO_TIME);
+       setTimeout(robot_adder, c.ROBO_TIME*1000);
     }
 }
 
@@ -50,7 +50,7 @@ var robot_adder = function() {
     }
     game = new Game(players.slice()); // array copy
     health.inc();
-    game.start(c.MS_PER_FRAME);
+    game.start(1000/c.FPS);
     players = [];
 }
 //
index b1fc33e6d7827189a8099d10ebf40b82163f2fce..e9de70536335dcaf99baab4de97fc3f7a08165f8 100644 (file)
@@ -21,6 +21,12 @@ var main = function() { // starts everything, gets us going, setup ish
     ctx.lineWidth = ctx.lineWidth/5;
 
     
+    // this is just to have everything go easily for testing
+    var othersockets = [];
+    for(var i=0; i<c.NUM_PLAYERS -1; i++) {
+       othersockets.push(new WebSocket(prefixurl));
+    }
+
     
     theSocket = new WebSocket(prefixurl);
     theSocket.onmessage = function(e) {