This PR enhances the current hitbox system to improve collision detection, and fixes several related bugs.
See also #72 #42 and #35.
Fixed several bugs such as NPCs bugging through hitboxes or out of bounds, and the Player being set back to an illogical position when colliding with objects from the wrong direction.
Implemented by @raphael-pietrzak:
Enhanced the hitbox functionality for better collision detection.
Main layer based on bottom hitbox.
Created a test function to draw rects and hitboxes when the [H] key is pressed.
Draw apples with the tree.
Implemented by @michelfinley:
Object hitboxes can now be defined in Tiled's tile collision editor
Entities may now have custom hitboxes depending on their current animation. They can be defined in sprites.setup.EntityAssets.
new Enums for entity Direction, EntityState and Tilesets
Media
sprite rect and hitbox overlay
Object hitboxes can be added in Tiled's tile collision editor
Checklist
[X] I have tested this change locally and it works as expected.
[x] I have made sure that the code follows the formatting and style guidelines of the project.
[X] Since this PR modifies related documentation, I have proofread files for spelling and grammar errors.
Summary
This PR enhances the current hitbox system to improve collision detection, and fixes several related bugs.
See also #72 #42 and #35.
Fixed several bugs such as NPCs bugging through hitboxes or out of bounds, and the Player being set back to an illogical position when colliding with objects from the wrong direction.
Implemented by @raphael-pietrzak:
Implemented by @michelfinley:
Media
Checklist
Labels
https://github.com/sloukit/pydew-valley-uzh/labels/area%3A%20code%20quality https://github.com/sloukit/pydew-valley-uzh/labels/game-mechanics https://github.com/sloukit/pydew-valley-uzh/labels/priority%3A%20high https://github.com/sloukit/pydew-valley-uzh/labels/type%3A%20enhancement