TurtleBrains  0.3.5
High quality, portable, C++ framework for rapid 2D game development.
Entity Collision

TurtleBrains has built-in support for basic intersection tests for the bounding volumes of an entity. This includes axis-aligned bounding boxes (AABB) and circles. Calling AddBoundingBox or AddBoundingCircle to an entity will automatically make that entity collidable and start performing collision (intersection) tests against the bounding volumes of other collidable entities.

When Entities Collide

When an entity collides the TurtleBrains::Game::Entity::OnCollideWith() function is invoked for BOTH entities, passing the other within. Consider a small world with two entities, a ship and an island. If the bounding volumes for both entities are overlapping ship.OnCollideWith() will be called with island being the parameter passed through, then island.OnCollideWith() will be called with the ship being passed. The order of calling is not specified.