mirror of
https://github.com/Phantop/LADXHD.git
synced 2024-11-01 12:24:16 +00:00
29 lines
770 B
C#
29 lines
770 B
C#
|
using ProjectZ.Base;
|
|||
|
using ProjectZ.InGame.Things;
|
|||
|
|
|||
|
namespace ProjectZ.InGame.GameObjects.Base.Components
|
|||
|
{
|
|||
|
class BodyCollisionComponent : CollisionComponent
|
|||
|
{
|
|||
|
public BodyComponent Body;
|
|||
|
|
|||
|
public bool IsActive = true;
|
|||
|
|
|||
|
public BodyCollisionComponent(BodyComponent body, Values.CollisionTypes collisionType)
|
|||
|
{
|
|||
|
Body = body;
|
|||
|
CollisionType = collisionType;
|
|||
|
Collision = IsColliding;
|
|||
|
}
|
|||
|
|
|||
|
public bool IsColliding(Box box, int dir, int level, ref Box collidingBox)
|
|||
|
{
|
|||
|
if (!IsActive || !box.Intersects(Body.BodyBox.Box))
|
|||
|
return false;
|
|||
|
|
|||
|
collidingBox = Body.BodyBox.Box;
|
|||
|
return true;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|