public static bool CollisionWithBorders(Interfaces.ICollisionable obj, int width, int height) { if (obj.PosX < 0 || obj.PosX > width - obj.Size || obj.PosY < 0 || obj.PosY > height - obj.Size) { return(true); } return(false); }
public static bool CollisionBox(Interfaces.ICollisionable obj1, Interfaces.ICollisionable obj2) { return(CheckCollision(obj1.PosX, obj1.PosY, obj1.Size, obj2.PosX, obj2.PosY, obj2.Size)); }