示例#1
0
        /// <summary>
        /// Perform a slashing attack in the direction this actor is facing
        /// </summary>
        public void SlashAttack()
        {
            if ( mCurrentAction == null )
            {
                MovementComponent movement = Owner.GetComponent<MovementComponent>();
                movement.CancelMove();

                mCurrentAction = new ActionSlashAttack( Owner, Owner.Direction );
            }
        }
示例#2
0
        /// <summary>
        /// Updates the state of the game actor
        /// </summary>
        /// <param name="gameTime"></param>
        public override void Update( GameTime gameTime )
        {
            if ( mCurrentAction != null )
            {
                mCurrentAction.Update( gameTime );

                // Cancel out the active action if it has completed
                if ( mCurrentAction.IsFinished )
                {
                    mCurrentAction = null;
                }
            }
        }