예제 #1
0
        public void Update()
        {
            patternAlive = false;
            for (int i = Lists.enemyList.Count - 1; i >= 0; i--)
            {
                EnemyPrime enemy = Lists.enemyList[i];
                if (enemy.GetBoss())
                {
                    patternAlive = true;
                    bossPosition = new Vector2(enemy.GetRealX(), enemy.GetRealY());
                }
            }
            if (Lists.enemyList.Count == 0 || patternAlive == false)
            {
                currentPattern += 1;
            }


            if (patternAlive == false)
            {
                if (currentPattern == 2)
                {
                    ClearBullets(true);
                    CreateEnemy(new Pattern02(bossPosition));
                }
                else if (currentPattern == 3)
                {
                    ClearBullets(true);
                    CreateEnemy(new Pattern03(bossPosition));
                }
                else if (currentPattern == 4)
                {
                    ClearBullets(true);
                    CreateEnemy(new Pattern04(bossPosition));
                }
                else if (currentPattern == 5)
                {
                    ClearBullets(true);
                    CreateEnemy(new Pattern05(bossPosition));
                }
                else if (currentPattern == 6)
                {
                    ClearBullets(true);
                    CreateEnemy(new Pattern06(bossPosition));
                }
                else if (currentPattern == 7)
                {
                    ClearBullets(true);
                    CreateEnemy(new Pattern07(bossPosition));
                }
                else
                {
                    ClearBullets(true);
                    bossAlive = false;
                }
            }
        }
예제 #2
0
        public virtual void Update()
        {
            for (int i = 0; i <= Lists.enemyList.Count - 1; i++)
            {
                EnemyPrime enemy = Lists.enemyList[i];
                if (Vector2.Distance(this.position, new Vector2(enemy.GetRealX(), enemy.GetRealY())) < enemy.GetHitBox02())
                {
                    HitEnemy(i);
                }
            }
            angle    += turnSpeed;
            speed    += acceleration;
            velocity  = new Vector2(Cos(angle) * speed, Sin(angle) * speed);
            position += velocity;

            if (position.X < PlayScreenMinX - 50 || position.X > PlayScreenMaxX + 50 || position.Y < PlayScreenMinY - 50 || position.Y > PlayScreenMaxY + 50)
            {
                Destroy();
            }

            color = new Color(255, 255, 255, 190);
        }