add start of client rendering

This commit is contained in:
Asraelite 2016-03-21 16:15:49 +00:00
parent 9787a9d468
commit ebcee954bf
13 changed files with 127 additions and 7 deletions

17
public/js/starbugs/net.js Normal file
View file

@ -0,0 +1,17 @@
function Net() {
this.socket;
this.connect = function() {
this.socket = io.connect('http://localhost:8080');
this.socket.on('connect', function() {
game.connected = true;
game.state = 'connected';
});
this.socket.on('disconnect', function() {
game.connected = false;
game.state = 'disconnected';
});
};
}