super-mario-python
super-mario-python copied to clipboard
Fix: Mario correctly kicks still Koopa shells when boosting
Previously, when you were boosting (holding shift) and ran into a still Koopa shell, Mario would die instead of kicking the shell.
This commit refactors the _onCollisionWithMob method in entities/Mario.py to:
- Ensure that kicking a still Koopa shell is prioritized over Mario dying if the conditions for a kick are met (side collision with a live, non-active, non-bouncing Koopa).
- The Koopa shell now becomes
bouncingand is kicked in the appropriate direction. - A small nudge is given to the kicked shell to help prevent immediate re-collision with a fast-moving Mario.
- Additionally, I adjusted the logic for stomping an already still Koopa shell to make it start bouncing, aligning with common platformer mechanics.