public static TileIntersectsPlayer ( |
||
player | A player's bounding rectangle | |
block | A block's brounding rectangle | |
direction | CollisionDirection | Collision direction |
depth | Vector2 | Returned depth of the collision |
Результат | bool |
public static bool TileIntersectsPlayer(Rectangle player, Rectangle block, CollisionDirection direction, out Vector2 depth)
{
depth = direction == CollisionDirection.Vertical ? new Vector2(0, player.GetVerticalIntersectionDepth(block)) : new Vector2(player.GetHorizontalIntersectionDepth(block), 0);
return depth.Y != 0 || depth.X != 0;
}