Spaces:
Sleeping
Sleeping
Update static/scripts.js
Browse files- static/scripts.js +14 -1
static/scripts.js
CHANGED
@@ -1,4 +1,17 @@
|
|
1 |
-
const socket = io('
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
const canvas = document.getElementById('gameCanvas');
|
3 |
const ctx = canvas.getContext('2d');
|
4 |
const tileSize = 32;
|
|
|
1 |
+
const socket = io('https://broadfield-dev-dungeon-game.hf.space');
|
2 |
+
|
3 |
+
socket.on('connect', () => {
|
4 |
+
console.log('Connected to the server!');
|
5 |
+
});
|
6 |
+
|
7 |
+
socket.on('connect_error', (error) => {
|
8 |
+
console.error('Connection error:', error);
|
9 |
+
});
|
10 |
+
|
11 |
+
socket.on('disconnect', () => {
|
12 |
+
console.log('Disconnected from the server.');
|
13 |
+
});
|
14 |
+
|
15 |
const canvas = document.getElementById('gameCanvas');
|
16 |
const ctx = canvas.getContext('2d');
|
17 |
const tileSize = 32;
|