You are browsing as a guest. Sign up (or log in) to start making projects!

Open comments for this post

1h 43m 5s logged

The biggest change this session was a major refactor of how the code is organized across files. Fight.java was getting bloated as the game controller, so logic was redistributed to the classes that actually own it.

Board.java gained five new methods: printBoard() (the bordered grid renderer), spawnObjects(), checkObjectInteraction(), restoreHouseIfVacating(), and ejectFromHouseIfExpired(). All of the map object logic now lives alongside the board data it operates on, rather than sitting in the game controller as static helpers.

Opponent.java absorbed moveOpponentToward() and opponentAI() as instance methods. An opponent now knows how to move and take its turn — Fight.java just calls opponent.opponentAI(…) instead of running all that logic externally.

Fight.java is now significantly leaner, focused only on game setup, the turn loop, player input, and UI rendering.

On the bug fix side, the shield raise failure messages (“Something is in the way”) were moved out of raiseShield() and into the player-only call site. Previously these messages would print whenever the opponent AI tried and failed to raise its shield, which confused players who weren’t doing anything with their shield.

The board display was also reworked to use ANSI cursor column positioning (\033[nG) to force each cell to a fixed terminal column, solving a long-standing alignment issue where emoji with different display widths would push cells out of place.

The instructions screen was rewritten — cleaner language, shorter sentences, and a new map objects section explaining how the house, hospital, and heart work. The “(I) How to play” hint was moved to sit next to the “Choose your character” header so it’s visible before scrolling through the roster.

The README was also reviewed and is current.

0

Comments 0

No comments yet. Be the first!