Skip to content

Add collision detection algorithms for basic shapes #4

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
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

virtualzx-nad
Copy link

This PR implements collision detection algorithms for basic geometric shapes as requested in #1.

Implements:

  • Circle-Circle collision detection
  • Rectangle-Rectangle collision detection using AABB (Axis-Aligned Bounding Box)
  • Circle-Rectangle collision detection

Features:

  • Well-documented implementation with docstrings and examples
  • Comprehensive unit tests covering basic cases, edge cases, and various positions
  • Type hints for better code clarity
  • Efficient implementation using AABB for rectangle collisions

All tests are passing. The implementation follows project code style and conventions.

Fixes #1

Implements collision detection between:
- Circles
- Rectangles (using AABB)
- Circle and Rectangle

Includes:
- Well-documented implementation
- Comprehensive unit tests
- Type hints and docstrings

Fixes #1
@virtualzx-nad
Copy link
Author

This did not conform to the convention of the repo. Testing should be done in the main block of the script itself, not a separate file.

- Remove separate test file
- Add comprehensive doctests
- Add example usage in main block
- Follow project's testing convention
- Sort imports
- Fix line lengths
- Remove trailing whitespace
- Fix type annotations
- Clean up list comprehensions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a collision detection algorithm
1 participant