Refactor game engine with multi-enemy battles and pygame UI#1
Open
Refactor game engine with multi-enemy battles and pygame UI#1
Conversation
- Add CODEBASE_GUIDE.md with comprehensive documentation:
* Architecture overview with visual diagrams
* Detailed explanation of the 'AI-guided frontier map' system
(clarifying it's procedural generation, not actual AI/ML)
* Pygame UI issues and refactoring recommendations
* Extension guide for adding new classes, features, and items
- Add ui/pygame_ui_refactored.py as alternative implementation:
* Separates concerns into Panel, LayoutManager, GameRenderer,
InputHandler, and GameUI classes
* Uses panel-based layout that prevents text overlap
* Centralized configuration via UIConfig dataclass
* Easier to extend and maintain
* Drop-in compatible with original interface (run_pygame_ui())
All existing tests pass (25/25).
- Fix ui/pygame_ui.py text rendering: * Add boundary checking to _render_lines() to prevent overflow * Add max_y parameter to stop rendering before reaching another region * Add max_width parameter to truncate long lines with '...' * Status panel now bounded to Y=20-280 * Event log now bounded to Y=300-580 * Log entries dynamically limited based on available space - Add PYGAME_OVERLAY_FIX.md documentation: * Explains the three root causes of text overlap * Provides three solution approaches (quick fix, panel-based, scrollable) * Includes before/after visual diagrams * Step-by-step instructions for each approach All tests pass (25/25).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Testing
https://chatgpt.com/codex/tasks/task_e_68d03b5ee9f08328bb284b9157a11ea2