public bool IsHardMeetingEntity(Entity other) { if (CanCollideWithEntity(other)) { return(PositionedCollisionBox.Intersects(other.Physics.PositionedCollisionBox)); } return(false); }
public virtual void Update() { animationPlayer.Update(); if (syncAnimationWithDirection) { animationPlayer.SubStripIndex = unit.Direction; } if (isPhysicsEnabled) { for (int i = 0; i < unit.RoomControl.EntityCount; i++) { Entity entity = unit.RoomControl.Entities[i]; if (entity != unit && entity.Physics.IsEnabled && PositionedCollisionBox.Intersects(entity.Physics.PositionedSoftCollisionBox)) { OnCollideEntity(entity); } } } }
//----------------------------------------------------------------------------- // Accessors //----------------------------------------------------------------------------- public bool IsTouchingPlayer() { return(PositionedCollisionBox.Contains(roomControl.Player.Position)); //return (roomControl.Player.Physics.PositionedCollisionBox.Intersects(PositionedCollisionBox)); }