SkillAgentSearch skills...

CollisionBuddy

Monogame library for circle/line and tunnel-free circle/circle collision detection.

Install / Use

/learn @dmanning23/CollisionBuddy
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

CollisionBuddy

A quick little c# XNA/Monogame collision detection library for circle/line and tunnel-free circle/circle. Good for shmup!

This library checks for fast circle-circle collisions. It also prevents tunnelling... like say you shoot a bullet at an incoming missile, but the velocity is greater than the radius of the bullet, and it goes right through the missle because the collision would've occured between updates. That's tunnelling, and it sucks.

It also checks for circle-line collision, but that one doesn't prevent tunneling.

There is a cirlce-rect check in there that also checks for tunnelling. Assume you have an axis aligned box, you want the circle to stay inside that box. This method checks if it is touching or outside the walls, and if it is gives you a vector you can add to the circle position to put it back inside the box.

Sample code showing how to use the circle-rect functionality: https://github.com/dmanning23/CollisionBuddySample

Sample code showing how to use the circle-circle functionality: https://github.com/dmanning23/CollisionBuddyCircleCircleTest

Cheers!

View on GitHub
GitHub Stars6
CategoryDevelopment
Updated5mo ago
Forks1

Languages

C#

Security Score

82/100

Audited on Oct 10, 2025

No findings