Exemple #1
0
 public bool IsHardMeetingEntity(Entity other)
 {
     if (CanCollideWithEntity(other))
     {
         return(PositionedCollisionBox.Intersects(other.Physics.PositionedCollisionBox));
     }
     return(false);
 }
Exemple #2
0
        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);
                    }
                }
            }
        }
Exemple #3
0
        //-----------------------------------------------------------------------------
        // Accessors
        //-----------------------------------------------------------------------------

        public bool IsTouchingPlayer()
        {
            return(PositionedCollisionBox.Contains(roomControl.Player.Position));
            //return (roomControl.Player.Physics.PositionedCollisionBox.Intersects(PositionedCollisionBox));
        }