Stuck in wall bug (#5)

* Created a GetCollisionSide method.

* Bug Fixed and Tested

Co-authored-by: jme9 <jme9@pdx.edu>
This commit is contained in:
J. M. Ellis
2025-05-17 18:55:17 -07:00
committed by GitHub
parent 218f4da157
commit b9b339d51c
5 changed files with 90 additions and 19 deletions
+3 -3
View File
@@ -5,17 +5,17 @@ namespace LunaLightXMG
public class BoundingBox
{
public Rectangle Bounds { get; private set; }
public BoundingBox(Rectangle bounds)
{
Bounds = bounds;
}
public bool Intersects(BoundingBox other)
{
return Bounds.Intersects(other.Bounds);
}
public void Update(Vector2 position, int width, int height)
{
Bounds = new Rectangle((int)position.X, (int)position.Y, width, height);