예제 #1
0
        private void DashUpdate(float deltaTime)
        {
            mDashTimer.Update(deltaTime);

            if (mDashTimer.Rate() <= 0.3f)
            {
                mVelocity.X = GameDevice.Instance().GetRandom().Next(-1, 2) * mSpeed;
            }
            else
            {
                mVelocity.Y = 0;
                mVelocity.X = ((int)mCurrentDir - 2) * (mDashSpeed - (mDashTimer.Rate() * 500));
                if (mHitPoint <= mMaxHitPoint / 2)
                {
                    mVelocity.X = ((int)mCurrentDir - 2) * (mDashSpeed * 1.2f - (mDashTimer.Rate() * 500));
                }
            }

            if (mDashTimer.IsTime())
            {
                mDashTimer.Initialize();
                mAttackState = AttackState.Stay;
                if (mHitPoint <= mMaxHitPoint / 3)
                {
                    mAttackState = AttackState.Attack;
                }
            }
        }
예제 #2
0
        private void JumpUpdate(float deltaTime)
        {
            mJumpTimer.Update(deltaTime);
            if (mJumpTimer.Rate() <= 0.1f)
            {
                mVelocity.Y = -mJumpPower;
                if (mHitPoint <= mMaxHitPoint / 2)
                {
                    mVelocity.Y = -mJumpPower * 1.2f;
                }
            }
            mVelocity.X = ((int)mCurrentDir - 2) * mSpeed;
            if (mHitPoint <= mMaxHitPoint / 2)
            {
                mVelocity.X = ((int)mCurrentDir - 2) * mSpeed * 1.2f;
            }

            if (mJumpTimer.IsTime())
            {
                mJumpTimer.Initialize();
                mAttackState = AttackState.Stay;
            }
        }
예제 #3
0
 protected void DrawFadeIn()
 {
     GameDevice.Instance().GetRenderer().DrawTexture("fade", Vector2.Zero, 1 - mFadeTimer.Rate());
 }