Logged in as:

Login/Register

Sail the Boat Game!

Money: $0 | Fuel: 1000

if (typeof io === "undefined") { console.error("❌ ERROR: Socket.IO failed to load!"); } else { console.log("✅ Socket.IO loaded successfully!"); const socket = io('https://socket.drdaigle.org', { withCredentials: true, transports: ['websocket', 'polling'] }); // Handle collision detection socket.on('collisionDetected', ({ opponentId, opponentName }) => { console.log(`⚠️ Collision detected with ${opponentName} (${opponentId})`); const choice = confirm(`You collided with ${opponentName}. Choose "OK" for Battle or "Cancel" for Trade.`); if (choice) { console.log(`✅ Agreeing to battle with ${opponentName}`); socket.emit('agreeToBattle', { player1Id: socket.id, player2Id: opponentId }); } else { console.log(`✅ Requesting trade with ${opponentName}`); socket.emit('tradeRequest', { player1Id: socket.id, player2Id: opponentId }); } }); // ...existing code... } socket.on('startBattle', ({ opponentId }) => { console.log('✅ startBattle event received. Opponent ID:', opponentId); startBattleshipsGame(socket, opponentId); // Call the Battleships game function }); // ...existing code...