Permalink
Browse files

reverted log to debug, updated to Default v0.1.0

  • Loading branch information...
1 parent 61a9e44 commit 4f593842c67c3d28d2eccf92fb46218002457855 @Fabryz committed Apr 15, 2012
Showing with 16 additions and 20 deletions.
  1. +12 −12 public/js/Mangonel.js
  2. +4 −8 public/js/main.js
View
@@ -39,13 +39,13 @@
var vp = new Viewport(canvasWidth, canvasHeight);
- var log = function(msg) {
- console.log(new Date().toJSON() +": "+ msg);
+ var debug = function(msg) {
+ console.log(msg);
};
var stop = function() {
isPlaying = false;
- log('* Mangonel stopped.');
+ debug('* Mangonel stopped.');
};
var toggleDebugPanel = function(spd) {
@@ -77,7 +77,7 @@
var start = function() {
if (isReady) {
- log('* Mangonel started.');
+ debug('* Mangonel started.');
isPlaying = true;
$(window).keydown(function(e) {
@@ -148,7 +148,7 @@
loop();
} else {
- log('* Mangonel not ready.');
+ debug('* Mangonel not ready.');
}
};
@@ -273,8 +273,8 @@
player.x = data.player.x;
player.y = data.player.y;
- log('Received current player id: '+ player.id);
- log('You have joined the server.');
+ debug('Received current player id: '+ player.id);
+ debug('You have joined the server.');
});
socket.on('quit', function(data) {
@@ -289,7 +289,7 @@
}
}
- log('Player quitted: '+ quitter +' (id '+ data.id +')');
+ debug('Player quitted: '+ quitter +' (id '+ data.id +')');
});
socket.on('newplayer', function(data) {
@@ -301,7 +301,7 @@
newPlayer.lastMoveDir = data.player.lastMoveDir;
players.push(newPlayer);
- log('New player joined: '+ newPlayer.nick);
+ debug('New player joined: '+ newPlayer.nick);
tmpPlayer = {};
});
@@ -322,7 +322,7 @@
tmpPlayer = {};
}
- log('Initial player list received: '+ length +' players.');
+ debug('Initial player list received: '+ length +' players.');
});
socket.on('play', function(data) {
@@ -343,7 +343,7 @@
socket.on('ping', function(data) {
socket.emit('pong', { time: Date.now() });
- //log('Ping? Pong!');
+ //debug('Ping? Pong!');
});
socket.on('pingupdate', function(data) {
@@ -374,7 +374,7 @@
canvasWidth: canvasWidth,
canvasHeight: canvasHeight,
- log: log,
+ debug: debug,
start: start,
stop: stop,
loop: loop,
View
@@ -1,7 +1,6 @@
$(document).ready(function() {
- var clientId = $("#clientId"),
- tot = $("#tot");
+ var tot = $("#tot");
/*
* Main
@@ -14,21 +13,18 @@ $(document).ready(function() {
*/
Game.socket.on('connect', function() {
- Game.log('Connected.');
+ Game.debug('Connected.');
Game.start();
});
Game.socket.on('disconnect', function() {
- Game.log('Disconnected.');
+ Game.debug('Disconnected.');
Game.stop();
});
- Game.socket.on('clientId', function(data) {
- clientId.html(data.id);
- });
-
Game.socket.on('tot', function(data) {
tot.html(data.tot);
+ Game.debug("Current players number: "+ data.tot);
});
});

0 comments on commit 4f59384

Please sign in to comment.