-
Notifications
You must be signed in to change notification settings - Fork 0
Develop #59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
dmccoystephenson
wants to merge
115
commits into
main
Choose a base branch
from
develop
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Develop #59
Conversation
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
…entRepository, keyDownEventHandler, and ophidian modules
…ository refactor: update snake part management to use SnakePartRepository
…ository feat: implement EnvironmentRepository for managing game environment
…t-handler Input/key down event handler
…ocation dimensions
…id size adjustment
Graphics/renderer
…tRepository to an abstract interface
…prove initialization in PyEnvLibEnvironmentRepository
…ibEnvironmentRepository
…ronmentRepository
Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
…b-ff30-4755-a820-b56b627b15c5 Fix: Maintain Proportional Scaling and Centering on Window Resize with Complete Window Size Persistence
Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
…e-e934-442b-a458-2d5a2e1c718c Implement comprehensive Options Menu Screen with enhanced button feedback and ESC key navigation
Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
- Created GameEngine class for pure gameplay logic - Added InputHandler abstraction with implementations for GUI and Text UI - Added GameRenderer abstraction for rendering - Refactored Ophidian class to use abstractions - Maintains backward compatibility through property delegates - Added comprehensive architecture documentation Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
- Added InputAction.SELECT for menu selection - Updated TextUIInputHandler to map Enter key (\r, \n) to SELECT action - Fixed run_text_menu to use InputAction.SELECT instead of raw key check - Resolves issue where pressing Enter wouldn't start the game Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
- Added 13 tests for GameEngine (core gameplay logic) - Tests initialization, game state, direction input, updates, and integration - Added 25 tests for InputHandler abstraction - Tests InputAction constants, DirectionMapper mappings, and TextUIInputHandler - Validates critical direction mappings (UP=0, LEFT=1, DOWN=2, RIGHT=3) - Tests all key bindings including Enter, ESC, WASD, and arrow keys - All 38 new tests passing - Tests ensure game functionality won't break with future changes Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
- Fixed environment tests: Added 'difficulty' attribute to mock config - Fixed keyDownEventHandler tests: Added 'key_bindings', 'fullscreen', and 'limit_tick_speed' attributes to mock config - All 131 tests now passing (previously 17 were failing) Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
- Fixed bug where restarting game spawned duplicate food and snake entities - Removed duplicate initialization code in Ophidian.initialize() - GameEngine._initialize_level() already handles entity spawning - Added test to prevent regression: test_multiple_initializations_spawn_single_entities - All 132 tests passing Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
- Fixed KeyError that occurred when restarting game in pygame UI mode - Root cause: renderer held stale references to old environment after reinitialize - Solution: delegate to game_engine.check_for_level_progress_and_reinitialize() and recreate renderer with fresh environment references - Added 2 tests to prevent regression: test_reinitialize_clears_old_environment and test_multiple_reinitializations_no_stale_entities - All 134 tests passing Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
- Created .github/workflows/text-ui-gameplay.yml workflow - Added comprehensive integration test: tests/integration/test_text_ui_gameplay.py - Test verifies: initial state, game mechanics (movement), restart functionality, and text renderer output - Workflow runs on push/PR to main and develop branches - All 134 existing tests still passing - New integration test passes successfully Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
- Fixed termios error in GitHub Actions by gracefully handling missing TTY - Added skip_terminal_init parameter to Ophidian for testing/CI environments - Updated TextRenderer.enable_raw_mode() to catch termios/OSError exceptions - Integration test now runs successfully in CI without requiring terminal - All 77 existing unit tests still passing - Integration test verified locally Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
Performance Enhancements: - Added configurable framerate limiting (default 30 FPS) - Optimized screen clearing with ANSI escape codes (Unix/Linux/Mac) - Batch rendering: build frame in memory, single print operation - Decoupled input handling from game speed for better responsiveness - Reduced CPU usage from ~100% to ~5-15% Configuration Changes: - Added text_ui_target_fps setting (default: 30) - Saved/loaded in config/settings.json Code Improvements: - Delta-time based frame timing in run_text_ui() - Sleep during idle periods to prevent busy-waiting - Fixed short input timeout (0.01s) for responsive controls - Single-call rendering reduces I/O operations Testing: - All 77 existing tests passing - Integration test verified - Updated test for new clear_screen implementation - Added comprehensive performance documentation Documentation: - Created docs/TEXT_UI_PERFORMANCE.md with detailed analysis - Documented before/after metrics and technical details Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
…sed-ui-option Add text-based UI option with clean architecture, comprehensive testing, CI/CD verification, and performance optimizations
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.
No description provided.