Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions client.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ function connectToGameServer(socket) {
function createGame(options) {
options.controlsDisabled = false
window.game = engine(options)

setInterval(function() {
game.controls.on('changed', function() {
if (!connected) return
if (!game.controls.enabled) return
var state = {
Expand All @@ -66,7 +65,7 @@ function createGame(options) {
}
}
emitter.emit('state', state)
}, 1000/22)
});

var container = document.querySelector('#container')
game.appendTo(container)
Expand Down