Skip to content

Commit

Permalink
Merge pull request #446 from bazk/master
Browse files Browse the repository at this point in the history
Fix spectate mode only showing a part of the game
  • Loading branch information
abalabahaha authored Jul 24, 2016
2 parents 0c33646 + 8a1a8f4 commit 045e5a3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/client/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -607,5 +607,11 @@ window.addEventListener('resize', resize);
function resize() {
player.screenWidth = c.width = global.screenWidth = global.playerType == 'player' ? window.innerWidth : global.gameWidth;
player.screenHeight = c.height = global.screenHeight = global.playerType == 'player' ? window.innerHeight : global.gameHeight;

if (global.playerType == 'spectate') {
player.x = global.gameWidth / 2;
player.y = global.gameHeight / 2;
}

socket.emit('windowResized', { screenWidth: global.screenWidth, screenHeight: global.screenHeight });
}

0 comments on commit 045e5a3

Please sign in to comment.