From 9939249066befd6534a57a326b742e415bd59b15 Mon Sep 17 00:00:00 2001 From: salmonik Date: Sat, 11 Jul 2026 15:48:39 +0200 Subject: add floor transition: Space on exit descends to next depth --- src/main.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index e82d939..694773d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -110,7 +110,11 @@ fn main() { } else if cur_e && !prev_e { game.turn_right(); } else if cur_space && !prev_space { - game.attack(); + if game.on_exit() { + game.descend(); + } else { + game.attack(); + } } else if cur_z && !prev_z { game.use_item(); } else if cur_x && !prev_x { @@ -156,9 +160,10 @@ fn main() { } } - // ---- win check (placeholder — becomes staircase in Phase 1) ---- - if game.check_win() { - std::process::exit(0); + // ---- descend prompt ---- + // Show the prompt persistently while the player stands on the exit. + if game.on_exit() && game.state == GameState::WaitingForInput { + game.set_message("Press Space to descend..."); } // ---- render ---- -- cgit v1.2.3