Conversation
…camera position" This reverts commit 99fabbe.
…over the grid." This reverts commit 3fc7749.
… over the grid, that the camera moves with it.
…er moves over the grid, that the camera moves with it." This reverts commit c0315fb.
… over the grid, that the camera moves with it.
… after moving to different tiles.
…rld coordinates - Draw the grid and pathfinding visualization correctly aligned with the camera view - Scale the grid and path visualization according to the camera zoom level
… the player's position (player_center) and the mouse position (mouse_pos) to the grid.draw method. This ensures that the pathfinding algorithm starts from the player's position and updates dynamically based on the mouse click position. - Grid Rendering: The grid.draw method is called with the player's position and the mouse position, allowing the GridManager class to calculate and render the path from the player's position to the mouse click position.
…ng position - Removed old code test_grid.py since it was old code made with different use cases. - Removed deprecated file tile.py, no longer in use, was made to use as a base abstract class to edit tiles, but is no longer needed. - Added an option to see where your next position will be on with the click of the mouse key. - Grid is now always shown for the use case of debugging functionality.
- Simplified grid text rendering by caching text surfaces and optimized visible grid calculation based on camera bounds. - Added dynamic FPS display to the game window title. Minor cleanup and improved grid snapping logic in game state initialization.
…x and add visible radius to grid draw method
… offset and scale in movement logic
…function signatures to include camera parameters
…ameters and adjust draw method signature
Simplified and modularized the grid rendering code by introducing private helper methods for better readability and maintainability. These methods handle coordinate conversions, grid drawing, pathfinding visualization, and mouse indicator rendering.
Renamed the import path for `PlayerCamera` to reflect the updated file name and removed outdated commented code in the player camera class to improve code clarity and maintainability. No functional changes were made.
Introduced a new `PathFinder` class to encapsulate A* pathfinding functionality. Refactored `grid_manager.py` to use `PathFinder`, improving code structure and removing redundancy. Removed unused pathfinding-related code from `player.py` and streamlined logic for calculating paths.
…properly test the logic of pathfinding. Also removed old code from grid_manager.py related pathfinding.py logic.
Adjust method parameter indentation for consistency and readability. Replaced `assert` statements with exceptions to standardize error handling and improve robustness.
Tests the grid_manager calculations with unit tests BREAKING CHANGE: Refactor the GridManager to support initialization with either a tmx_map or a grid_matrix, improving flexibility and testability.
commit f183c95 Merge: ef6692f 68b393c Author: Davidek523 <davidov520@wp.pl> Date: Wed May 28 11:07:36 2025 +0200 Refactor unittest framework (#118) # Pull Request Template ## Type of Pull Request Only check one box per pull request. - [x] 🛠️ Code - Changes to the codebase. - [ ] 🔄 Revert - Reverts a previously merged commit or PR. - [ ] 📄 Documentation - Updates to documentation files. - [ ] 🎵 Audio - Changes to audio files. - [ ] 🎨 Asset - Updates to design or visual assets. ## Summary <!-- INSTRUCTIONS: - Briefly describe the purpose of this pull request. --> This PR <!-- adds|modifies|updates|fixes|reverts --> ... <!-- Briefly explain what the PR changes. --> refactors the `unit test` framework back to `pytest`, as specified in `requirements_dev.txt`. This change is useful as it simplified the creation of unit tests easier and adds additional support showing errors during testing. The update is also needed, to integrate the [Hypothesis](https://hypothesis.readthedocs.io/en/latest/index.html) library, which employs property based testing. Useful for testing edge cases you haven't thought of. Given the ongoing movement rework, associated with issues #103 & #104 which involved libraries such as NumPy and Pathfinding, it could be very useful. The unit test for the inventory was made by @AnSiChen, I integrated the `get_message` module in the unit test as well, this change could be better in the future if the inventory gets an overhaul, with mock testing for example, or with the use of Hypothesis to handle specific edge cases. ## Related Issues <!-- INSTRUCTIONS: - Mention related issue numbers here. - Example: "Fixes #123, Closes #456." --> This PR <!-- fixes|closes|addresses|reverts --> issue(s) <!-- (e.g., Fixes #123, Closes #456) --> --- ## ✅ Checklist: - [x] Tested the changes locally. - [x] Verified that no breaking changes are introduced. - [ ] Updated documentation (if applicable). ## 🏷️ Labels: `type: ...`, `area: ...`, `game-...`, ... <!-- Fill and expand on this line as needed. See https://github.com/PyCeas/Pyceas/wiki/Guide-to-using-labels for more information. --> commit 68b393c Author: ultimateownsz <saiutechnologies@outlook.com> Date: Mon May 26 00:42:51 2025 +0200 fix ruff import check A long error in the terminal when you ran ruff, has now been fixed: `include I` keyword was not found in terminal ruff check --select I --fix . commit dac598d Author: ultimateownsz <saiutechnologies@outlook.com> Date: Thu May 22 22:41:04 2025 +0200 fix ruff issues fix unit test assert commit c910ef1 Author: ultimateownsz <saiutechnologies@outlook.com> Date: Thu May 22 22:31:10 2025 +0200 Create .gitattributes Developers on different OSes won’t accidentally introduce line ending changes, keeping the repository history clean. commit 2955dc5 Author: ultimateownsz <saiutechnologies@outlook.com> Date: Thu May 22 22:24:45 2025 +0200 Refactor inventory unit tests Refactor inventory tests: migrate from unit test to `pytest` and update test structure Co-Authored-By: Anthony Em <139152052+AnSiChen@users.noreply.github.com>
…rid-overlay-(103)-numpy
This commit introduces three new documentation guides: - Coordinate Conversions Guide - Camera Guide - Grid Manager Guide. - PathfindingAStar Guide These guides cover essential concepts like coordinate systems, camera offsets/scales, grid rendering, and interaction handling, providing detailed examples and use cases for game development. proper conversion processes, controls, and edge case handling are also documented.
This fixes some imports, mypy issues.
BREAKING CHANGE: Mypy can complain for some reasons, For Python 3.10+ you need to do this like seen below:
# PEP 604 syntax, requires Python 3.10+ or `from __future__ import annotations`
def good(x: int | None = None):
...
https://github.com/hauntsaninja/no_implicit_optional
This change adds the Hypothesis library to `requirements_dev.txt` to support property-based testing. Existing dependencies remain unchanged, ensuring compatibility and functionality.
Davidek523
approved these changes
May 29, 2025
Collaborator
Davidek523
left a comment
There was a problem hiding this comment.
The movement is a huge upgrade! It works well! Nice addition in form of a debug button for the grid. The unittest for the grid also works fine. No errors, no crashes nor bugs, approved!
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.
Pull Request Template
Type of Pull Request
Only check one box per pull request.
Summary
This PR refactors and improves various components:
requirements.txt: numpy & pathfindingrequirements_dev.txt: hypothesis (property-based unit testing)display.set_captioningame_manager.py.Related Issues
This PR addresses ongoing movement and grid-related improvements, facilitating better interaction and debugging functionality.
Fixes #90
Closes #103, #104
✅ Checklist: