Axis-Aligned Bounding Boxes

You need only four terms to detect a collision.

Axis-Aligned Bounding Boxes

I illustrated the collision detection algorithm for axis-aligned bounding boxes.

2D collision detection - Game development | MDN
Algorithms to detect collision in 2D games depend on the type of shapes that can collide (e.g. Rectangle to Rectangle, Rectangle to Circle, Circle to Circle). Generally you will have a simple generic shape that covers the entity known as a “hitbox” so even though collision may not be pixel perfect,…