mirror of
https://github.com/Such-Software/wownerogue.git
synced 2026-12-04 12:54:08 +01:00
fix: fog-of-war entities, multi-level descend feedback, camera centering, fewer levels
- FOG: sceneFromGameState only emits exit/entrance/treasure/items once their cell is EXPLORED, and the monster only while IN VIEW — no more exit stairs leaking through the fog. - DESCEND FEEDBACK: reaching a non-final exit descends (multi-level) and used to silently dump the player at a new entrance (read as a bug). Server now sends depth/maxDepth on game_event; the client shows "Stairs down! Level N of M — keep going". Also lowered level counts (WOW 4->2, BTC 8->3, XMR 2->1) — clearing 4-8 levels in one block was unwinnable; kept modest until proper multi-level calibration + UX. - CAMERA: the host filled the very-tall #game-display so centering put the player low; it's now a bounded viewport (min(100%,78vh)) centered in #game-display, so the player stays on-screen-centered. Suite 62/435 green.
This commit is contained in:
@@ -130,6 +130,20 @@ const SocketHandlers = {
|
||||
socket.on('game_start', this.onGameStart);
|
||||
socket.on('game_update', this.onGameUpdate);
|
||||
socket.on('game_over', this.onGameOver);
|
||||
// Discrete in-run events. Multi-level DESCEND is the big one — without this, taking the
|
||||
// stairs down silently dumped the player at a new entrance and read as a bug.
|
||||
socket.on('game_event', function (data) {
|
||||
if (!data || !data.event) return;
|
||||
var $m = $('#messages');
|
||||
if (data.event === 'descend') {
|
||||
var lvl = (data.depth && data.maxDepth) ? ('Level ' + data.depth + ' of ' + data.maxDepth + ' — ') : '';
|
||||
$m.append($('<li class="status" style="color:#ffcc00; font-weight:bold;">')
|
||||
.text('⬇️ Stairs down! ' + lvl + 'keep going — escape before the block!'));
|
||||
} else if (data.event === 'treasure_found') {
|
||||
$m.append($('<li class="status" style="color:#fbbf24; font-weight:bold;">').text('💰 Treasure secured!'));
|
||||
} else return;
|
||||
if (typeof UI !== 'undefined' && UI.scrollChat) UI.scrollChat();
|
||||
});
|
||||
socket.on('queue_cancelled', this.onQueueCancelled);
|
||||
|
||||
// Payment/Address handlers
|
||||
|
||||
Reference in New Issue
Block a user