Progress: client

This commit is contained in:
Jeremiah Billmann
2013-05-24 21:48:07 -04:00
parent 3f888c7935
commit bc39634a78
6 changed files with 186 additions and 14 deletions
+6 -6
View File
@@ -4,21 +4,21 @@ window.GarageServerIO = (function (window, socketio) {
garageServerGame = null,
// TODO: DONE CALLBACK
connectToGarageServer = function (path, options) {
io.connect(path + '/garageserver.io');
registerSocketEvents();
registerSocketEvents(io.connect(path + '/garageserver.io'));
},
registerSocketEvents = function () {
io.on('update', function(data) {
registerSocketEvents = function (socket) {
socket.on('update', function(data) {
if(garageServerGame.addPlayerInput) {
garageServerGame.addPlayerInput(data);
}
});
io.on('ping', function(data) {
socket.on('ping', function(data) {
});
io.on('removePlayer', function(id) {
socket.on('removePlayer', function(id) {
if(garageServerGame.removePlayer) {
garageServerGame.removePlayer(id);
}