From de2c02a3889fb3970a2c742b0498004af4506872 Mon Sep 17 00:00:00 2001 From: John Daniel Date: Thu, 8 Oct 2015 14:45:52 +0200 Subject: [PATCH] fixes the bug that causes the ball to pass through platform at start --- game.js | 4 ++-- gamestarter.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/game.js b/game.js index 2fd41d0..fa89be2 100644 --- a/game.js +++ b/game.js @@ -118,7 +118,7 @@ Ball.prototype.move = function(){ //TODO: Check for a hit with platform } - if (!this.dX || !this.dY) this.calculatedXdY(); + if ((this.dY == null) || (this.dY == null)) this.calculatedXdY(); this.oldX = this.x; this.oldY = this.y; @@ -310,4 +310,4 @@ var step = function(timestamp){ var startGame = function(){ init(); window.requestAnimationFrame(step); -} \ No newline at end of file +} diff --git a/gamestarter.js b/gamestarter.js index 0a6a20f..b03b1c8 100644 --- a/gamestarter.js +++ b/gamestarter.js @@ -3,7 +3,7 @@ var port = 1337; var portP1 = 1338; var portP2 = 1339; -var ip = "192.168.0.102"; +var ip = "localhost"; var WS_START = "ws://"; var connectMsg = "connected";