game and display mostly working, using autostart for now to work on lighting (dim explored tiles out of FoV)

This commit is contained in:
jwinterm
2025-05-25 15:10:45 -04:00
parent 0818b60541
commit 1db2fc818c
17 changed files with 1624 additions and 1467 deletions
+5 -5
View File
@@ -133,17 +133,17 @@ function checkGamesTimeout(currentHeight) {
activeGames.forEach((game, socketId) => {
const user = getUserBySocket(socketId);
// Player must escape before the next block after their start block
// If they started on block 2, they must escape before block 3 is found
if (user && user.blockRec && currentHeight > user.blockRec) {
console.log(`Game timeout for player ${socketId}: started on block ${user.blockRec}, current block ${currentHeight}`);
// Player has 3 blocks to complete the dungeon
// If they started on block 2, they must escape before block 5 is found
if (user && user.blockRec && currentHeight > user.blockRec + 2) {
console.log(`Game timeout for player ${socketId}: started on block ${user.blockRec}, current block ${currentHeight} (allowed until block ${user.blockRec + 2})`);
// Game has timed out - player didn't escape in time
game.gameState = 'lost';
io.to(socketId).emit('game_over', {
status: 'lost',
reason: 'timeout',
message: 'You didn\'t escape before the next block was found!'
message: 'You didn\'t escape before the block time limit!'
});
activeGames.delete(socketId);