Two rectangles are passed in, you decide if they "intersect".Can anyone explain to me how
public virtual bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox)
in modProjectile works?
I'm trying to make a projectile have a damaging trail
Vanilla code just checks Rectangle.Intersects(Ractangle).
The projHitbox is based on projectile.width, projectile.height, projectile.position. Similar for the targetHitbox (but for an npc maybe).
Sometimes rectangles aren't perfect for what you want, such as MoonLords beam or Last Prism laser. If you made a bounding box around a laser, it would intersect with a lot of things the visuals don't show it actually hitting.
Use Collision.CheckAABBvLineCollision if you want :
public static bool CheckAABBvLineCollision(Vector2 objectPosition, Vector2 objectDimensions, Vector2 lineStart, Vector2 lineEnd, float lineWidth, ref float collisionPoint)