Beispiel #1
0
        public override void update()
        {
            cooldown--;


            if (cooldown <= 0)
            {
                if (enemyType == 0)
                {
                    Enemy enemy = new Enemy();
                    enemy.x = Game1.global.windowWidth / 2;
                    enemy.y = Game1.global.windowHeight / 2;
                    Game1.global.ListOfEnemies.Add(enemy);
                    enemiesSoFar++;
                    cooldown = 15;
                }
                else
                {
                    EnemyBouncer enemy = new EnemyBouncer();
                    enemy.x = Game1.global.windowWidth / 2;
                    enemy.y = Game1.global.windowHeight / 2;
                    Game1.global.ListOfEnemyBouncers.Add(enemy);
                    enemiesSoFar++;
                    cooldown = 15;
                }
            }
        }
Beispiel #2
0
        public override void update()
        {
            cooldown--;
            if (cooldown <= 0)
            {
                cooldown = 15;
                if (enemyType == 0)
                {
                    Enemy enemy = new Enemy();
                    enemy.x = enemy.width;
                    enemy.y = enemy.height;
                    Game1.global.ListOfEnemies.Add(enemy);

                    Enemy enemy1 = new Enemy();
                    enemy1.x = Game1.global.windowWidth;
                    enemy1.y = enemy.height;
                    Game1.global.ListOfEnemies.Add(enemy1);

                    Enemy enemy2 = new Enemy();
                    enemy2.x = enemy.width;
                    enemy2.y = Game1.global.windowHeight;
                    Game1.global.ListOfEnemies.Add(enemy2);

                    Enemy enemy3 = new Enemy();
                    enemy3.x = Game1.global.windowWidth;
                    enemy3.y = Game1.global.windowHeight;
                    Game1.global.ListOfEnemies.Add(enemy3);

                    enemiesSoFar++;
                }
                else
                {
                    EnemyBouncer enemy = new EnemyBouncer();
                    enemy.x = enemy.width;
                    enemy.y = enemy.height;
                    Game1.global.ListOfEnemyBouncers.Add(enemy);

                    EnemyBouncer enemy1 = new EnemyBouncer();
                    enemy1.x = Game1.global.windowWidth;
                    enemy1.y = enemy.height;
                    Game1.global.ListOfEnemyBouncers.Add(enemy1);

                    EnemyBouncer enemy2 = new EnemyBouncer();
                    enemy2.x = enemy.width;
                    enemy2.y = Game1.global.windowHeight;
                    Game1.global.ListOfEnemyBouncers.Add(enemy2);

                    EnemyBouncer enemy3 = new EnemyBouncer();
                    enemy3.x = Game1.global.windowWidth;
                    enemy3.y = Game1.global.windowHeight;
                    Game1.global.ListOfEnemyBouncers.Add(enemy3);
                    enemiesSoFar++;
                }
            }
        }
Beispiel #3
0
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            // TODO: use this.Content to load your game content here
            Enemy.loadResources();
            Bullet.loadResources();
            Hud.loadRecources();
            EnemyBouncer.loadResources();
        }
        public override void update()
        {
            cooldown--;
            if (cooldown <= 0)
            {
                if (enemyType == 0)
                {
                    cooldown = 5;
                    enemiesSoFar++;

                    Enemy enemy = new Enemy();
                    if (enemiesSoFar == 1)
                    {
                        enemy.x = enemy.width;
                        enemy.y = enemy.height;
                    }
                    enemy.x     = enemy.width;
                    enemy.y     = enemy.height + 40 + enemy.height * enemiesSoFar;
                    enemy.speed = 2.1f;
                    Game1.global.ListOfEnemies.Add(enemy);
                    enemiesSoFar++;
                    Enemy enemy1 = new Enemy();
                    enemy1.x     = Game1.global.windowWidth;
                    enemy1.y     = enemy.height + 5 + enemy.height * enemiesSoFar;
                    enemy1.speed = 2.1f;
                    Game1.global.ListOfEnemies.Add(enemy1);
                }
                else
                {
                    cooldown = 5;
                    enemiesSoFar++;

                    EnemyBouncer enemy = new EnemyBouncer();
                    if (enemiesSoFar == 1)
                    {
                        enemy.x = enemy.width;
                        enemy.y = enemy.height;
                    }
                    enemy.x     = enemy.width;
                    enemy.y     = enemy.height + 40 + enemy.height * enemiesSoFar;
                    enemy.speed = 2.1f;
                    Game1.global.ListOfEnemyBouncers.Add(enemy);
                    enemiesSoFar++;
                    EnemyBouncer enemy1 = new EnemyBouncer();
                    enemy1.x     = Game1.global.windowWidth;
                    enemy1.y     = enemy.height + 5 + enemy.height * enemiesSoFar;
                    enemy1.speed = 2.1f;
                    Game1.global.ListOfEnemyBouncers.Add(enemy1);
                }
            }
        }
        public override void update()
        {
            int enemyType        = 0;
            int generationNumber = Game1.global.rand.Next(0, 100);

            if (generationNumber < enemyChances)
            {
                enemyType = 1;
            }

            cooldown--;

            if (cooldown <= 15)
            {
                if (enemyType == 0)
                {
                    Enemy enemy = new Enemy();
                    enemy.x = x + enemiesSoFar * spacing;
                    enemy.y = y + enemiesSoFar * spacing;
                    Game1.global.ListOfEnemies.Add(enemy);
                    enemiesSoFar++;

                    Enemy enemy2 = new Enemy();
                    enemy2.x = x - enemiesSoFar * spacing;
                    enemy2.y = y + enemiesSoFar * spacing;
                    Game1.global.ListOfEnemies.Add(enemy2);
                    enemiesSoFar++;

                    Enemy enemy3 = new Enemy();
                    enemy3.x = x + enemiesSoFar * spacing;
                    enemy3.y = y - enemiesSoFar * spacing;
                    Game1.global.ListOfEnemies.Add(enemy3);
                    enemiesSoFar++;

                    Enemy enemy4 = new Enemy();
                    enemy4.x = x - enemiesSoFar * spacing;
                    enemy4.y = y - enemiesSoFar * spacing;
                    Game1.global.ListOfEnemies.Add(enemy4);
                    cooldown = 30;
                    enemiesSoFar++;
                }
                else
                {
                    EnemyBouncer enemy = new EnemyBouncer();
                    enemy.x = x + enemiesSoFar * spacing;
                    enemy.y = y + enemiesSoFar * spacing;
                    Game1.global.ListOfEnemyBouncers.Add(enemy);
                    enemiesSoFar++;

                    EnemyBouncer enemy2 = new EnemyBouncer();
                    enemy2.x = x - enemiesSoFar * spacing;
                    enemy2.y = y + enemiesSoFar * spacing;
                    Game1.global.ListOfEnemyBouncers.Add(enemy2);
                    enemiesSoFar++;

                    EnemyBouncer enemy3 = new EnemyBouncer();
                    enemy3.x = x + enemiesSoFar * spacing;
                    enemy3.y = y - enemiesSoFar * spacing;
                    Game1.global.ListOfEnemyBouncers.Add(enemy3);
                    enemiesSoFar++;

                    EnemyBouncer enemy4 = new EnemyBouncer();
                    enemy4.x = x - enemiesSoFar * spacing;
                    enemy4.y = y - enemiesSoFar * spacing;
                    Game1.global.ListOfEnemyBouncers.Add(enemy4);
                    cooldown = 30;
                    enemiesSoFar++;
                }
            }
        }