add start of client rendering
This commit is contained in:
parent
9787a9d468
commit
ebcee954bf
13 changed files with 127 additions and 7 deletions
17
public/js/starbugs/net.js
Normal file
17
public/js/starbugs/net.js
Normal 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';
|
||||
});
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue