diff --git a/example/public/javascripts/game.js b/example/public/javascripts/game.js index d5c03c6..4b86f5f 100644 --- a/example/public/javascripts/game.js +++ b/example/public/javascripts/game.js @@ -35,7 +35,9 @@ $(function () { drawRotatedImage(entity.state.ang, entity.state.x, entity.state.y, entityImage); }); playerStates.forEach(function (player) { - drawRotatedImage(player.state.ang, player.state.x, player.state.y, ships[player.state.ship]); + if (player.state.ship) { + drawRotatedImage(player.state.ang, player.state.x, player.state.y, ships[player.state.ship]); + } }); }, //Update Loop