mini_arcade_core.spaces.d2.collision2d¶
2D collision detection helpers.
Classes¶
Abstract base class for 2D colliders. |
|
OOP collision helper that wraps a Position2D + Size2D pair. |
Module Contents¶
- class mini_arcade_core.spaces.d2.collision2d.Collider2D[source]¶
Bases:
abc.ABCAbstract base class for 2D colliders.
- abstractmethod intersects(other: Collider2D) bool[source]¶
Check if this collider intersects with another collider.
- Parameters:
other (Collider2D) – The other collider to check against.
- Returns:
True if the colliders intersect.
- Return type:
bool
- class mini_arcade_core.spaces.d2.collision2d.RectCollider[source]¶
Bases:
Collider2DOOP collision helper that wraps a Position2D + Size2D pair.
It does NOT own the data - it just points to them. If the entity moves (position changes), the collider “sees” it.
- Variables:
- intersects(other: RectCollider) bool[source]¶
High-level OOP method to check collision with another collider.
;param other: The other rectangle collider. :type other: RectCollider
- Returns:
True if the rectangles intersect.
- Return type:
bool