Skip to content

Adds next dungeon level message#135

Merged
LiquidityC merged 1 commit into
devfrom
add_next_level_message
Oct 10, 2025
Merged

Adds next dungeon level message#135
LiquidityC merged 1 commit into
devfrom
add_next_level_message

Conversation

@LiquidityC

@LiquidityC LiquidityC commented Oct 10, 2025

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • Enhancements
    • On entering a new dungeon level, the game now displays an on-screen message with the level number and adds an entry to the in-game log. This provides clearer feedback during progression and helps players track their journey between floors. Notifications appear alongside existing sounds and music cues when advancing to the next level.

@LiquidityC LiquidityC enabled auto-merge (squash) October 10, 2025 08:51
@coderabbitai

coderabbitai Bot commented Oct 10, 2025

Copy link
Copy Markdown

Walkthrough

Adds two UI calls on advancing to a new dungeon level: logs the level via gui_log and displays an event message via gui_event_message, in the same branch that already plays an effect, selects music, and may reset the game.

Changes

Cohort / File(s) Summary
Dungeon level transition UI updates
src/main.c
On NEXT_LEVEL, add gui_log for new level and gui_event_message to display the level, alongside existing mixer_play_effect, choose_music, and resetGame logic.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant P as Player
    participant GE as GameEngine
    participant AM as AudioMixer
    participant MM as MusicManager
    participant GUI as GUI

    P->>GE: Trigger NEXT_LEVEL
    GE->>AM: mixer_play_effect(level_up)
    GE->>MM: choose_music(for new level)
    GE->>GUI: gui_log("Entered level N")
    GE->>GUI: gui_event_message("Dungeon level N")
    alt reset required
        GE->>GE: resetGame()
        note right of GE: Internal state reset if applicable
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I hop to the next, a stairwell’s tune,
Drums go boom—new music soon.
I scribble logs with whiskered flair,
Flash a message: “Level? There!”
Pixel burrow, deeper dive—
Carrot-ready, I thrive and jive. 🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title clearly summarizes the addition of a message when entering the next dungeon level, matching the changes that introduce gui_log and gui_event_message calls for level transitions.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch add_next_level_message

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
src/main.c (1)

907-908: LGTM! Clear and consistent UI feedback for level progression.

The addition of both gui_log and gui_event_message calls follows the established pattern used elsewhere in the codebase for important events (e.g., lines 297-298, 407-408, 872-873). The messages are clear and appropriately placed in the level transition flow.

Optional nitpick: Consider using %u instead of %d for the unsigned cLevel variable for better type safety:

-		gui_log("You descend the stairs. You have reached dungeon level %d", cLevel);
-		gui_event_message("Dungeon level %d", cLevel);
+		gui_log("You descend the stairs. You have reached dungeon level %u", cLevel);
+		gui_event_message("Dungeon level %u", cLevel);

This is a very minor point and unlikely to cause any practical issues given the expected range of level numbers.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 609f9df and 1326a64.

📒 Files selected for processing (1)
  • src/main.c (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/main.c (1)
src/gui.c (2)
  • gui_log (575-603)
  • gui_event_message (605-622)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: Analyze (c-cpp)
  • GitHub Check: Ubuntu (Clang)
  • GitHub Check: Mac (Clang)
  • GitHub Check: Ubuntu (GCC)
  • GitHub Check: Windows (MSVC)
  • GitHub Check: Mac (GCC)
  • GitHub Check: Ubuntu (mingw)

@LiquidityC LiquidityC merged commit 6ca7ad4 into dev Oct 10, 2025
10 checks passed
@LiquidityC LiquidityC deleted the add_next_level_message branch October 10, 2025 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant