From 50124ab9b979bb51b90b839e39954bf2e8a04a50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Volkan=20=C3=96zdemir?= Date: Fri, 10 Jun 2016 21:27:03 +0300 Subject: [PATCH] Fix for "Cannot read property 'y2' of undefined" error --- blank_game_multiplayer/assets/PlayerTexture.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/blank_game_multiplayer/assets/PlayerTexture.js b/blank_game_multiplayer/assets/PlayerTexture.js index 8f422e8f8..d05970ef7 100644 --- a/blank_game_multiplayer/assets/PlayerTexture.js +++ b/blank_game_multiplayer/assets/PlayerTexture.js @@ -3,11 +3,11 @@ var image = { // Draw the player entity ctx.strokeStyle = 'rgba(255, 0, 0, 1)'; ctx.beginPath(); - ctx.moveTo(0, -entity._geometry.y2); - ctx.lineTo(entity._geometry.x2, entity._geometry.y2); - ctx.lineTo(0, entity._geometry.y2 - 5); - ctx.lineTo(-entity._geometry.x2, entity._geometry.y2); - ctx.lineTo(0, -entity._geometry.y2); + ctx.moveTo(0, -entity._bounds2d.y2); + ctx.lineTo(entity._bounds2d.x2, entity._bounds2d.y2); + ctx.lineTo(0, entity._bounds2d.y2 - 5); + ctx.lineTo(-entity._bounds2d.x2, entity._bounds2d.y2); + ctx.lineTo(0, -entity._bounds2d.y2); ctx.stroke(); } -}; \ No newline at end of file +};