Ultra minor updates.

This commit is contained in:
jme9
2025-03-05 12:38:51 -08:00
parent bab017e1a3
commit b270b8189b
14 changed files with 1421 additions and 16 deletions
+3 -3
View File
@@ -5,7 +5,7 @@ namespace LunaLightXMG
public class CollisionManager
{
// Method to check if a position is colliding with any platform
public bool IsColliding(Vector2 newPosition, BoundingBox boundingBox, Platform[] platforms)
public static bool IsColliding(Vector2 newPosition, BoundingBox boundingBox, Platform[] platforms)
{
Rectangle newBounds = new Rectangle((int)newPosition.X, (int)newPosition.Y, boundingBox.Bounds.Width, boundingBox.Bounds.Height);
foreach (var platform in platforms)
@@ -19,7 +19,7 @@ namespace LunaLightXMG
}
// Method to check if a position is colliding with any platform and return the colliding platform
public Platform GetCollidingPlatform(Vector2 newPosition, BoundingBox boundingBox, Platform[] platforms)
public static Platform GetCollidingPlatform(Vector2 newPosition, BoundingBox boundingBox, Platform[] platforms)
{
Rectangle newBounds = new Rectangle((int)newPosition.X, (int)newPosition.Y, boundingBox.Bounds.Width, boundingBox.Bounds.Height);
foreach (var platform in platforms)
@@ -33,7 +33,7 @@ namespace LunaLightXMG
}
// Method to check if a position is colliding with any wall
public bool WallCheck(Vector2 position, BoundingBox boundingBox, Platform[] platforms)
public static bool WallCheck(Vector2 position, BoundingBox boundingBox, Platform[] platforms)
{
if (IsColliding(position + new Vector2(1, 0), boundingBox, platforms) || IsColliding(position + new Vector2(-1, 0), boundingBox, platforms))
{