broadfield-dev commited on
Commit
2087e37
·
verified ·
1 Parent(s): ff684fc

Update static/scripts.js

Browse files
Files changed (1) hide show
  1. static/scripts.js +4 -2
static/scripts.js CHANGED
@@ -1,4 +1,6 @@
1
- const socket = io("http://broadfield-dev-dungeon-game.hf.space:7860"); // Adjust for deployment
 
 
2
 
3
  socket.on('connect', () => console.log('Connected to the server!'));
4
  socket.on('connect_error', (error) => console.error('Connection error:', error));
@@ -17,7 +19,7 @@ images['w'].src = '/static/wall.png';
17
  images['f'].src = '/static/floor.png';
18
  images['player'].src = '/static/player.png';
19
  images['goblin'].src = '/static/goblin.png';
20
- images['skeleton'].src = '/static/skeleton.png'; // Update if separate image
21
  images['potion'].src = '/static/potion.png';
22
  images['sword'].src = '/static/sword.png';
23
  images['door'].src = '/static/door.png';
 
1
+ const socket = io("https://broadfield-dev-dungeon-game.hf.space", {
2
+ transports: ['websocket'] // Force WebSocket for reliability
3
+ });
4
 
5
  socket.on('connect', () => console.log('Connected to the server!'));
6
  socket.on('connect_error', (error) => console.error('Connection error:', error));
 
19
  images['f'].src = '/static/floor.png';
20
  images['player'].src = '/static/player.png';
21
  images['goblin'].src = '/static/goblin.png';
22
+ images['skeleton'].src = '/static/skeleton.png';
23
  images['potion'].src = '/static/potion.png';
24
  images['sword'].src = '/static/sword.png';
25
  images['door'].src = '/static/door.png';