Exemplo n.º 1
0
        public static Chopper createNewChopper()
        {
            Chopper chopper = (Chopper)createNewObject("c");

            Interaction.holderAt(0).add(chopper);
            return(chopper);
        }
Exemplo n.º 2
0
        public override void move()
        {
            if (readyToTerminate())
            {
                muteAllSounds();
                isProjectorStopped = true;
                return;
            }
            if (!incarnatedChoppers && firstMove)
            {
                Chopper chopper = null;
                for (int i = 1; i <= 4; i++)
                {
                    chopper   = Mission.createNewChopper();
                    chopper.x = this.x + (4 - (2 * i));
                    chopper.y = this.y;
                    if (chopper.x == this.x)
                    {
                        chopper.x = this.x - 2;
                    }
                }
                incarnatedChoppers = true;
            }

            if (!incarnatedFighters && Mission.juliusDieCount == 1)
            {
                for (int i = 1; i <= 2; i++)
                {
                    Mission.createNewFighter(i, 10);
                }
                incarnatedFighters = true;
            }             //if !incarnated

            if (!incarnatedFighters2 && Mission.juliusDieCount == 2)
            {
                for (int i = 1; i <= 6; i++)
                {
                    Mission.createNewFighter(i, 5);
                }
                incarnatedFighters2 = true;
            }             //if !incarnated

            tickWeaponTimer();
            if (rechargeTime != 0)
            {
                playSound(chargeSound, false, true);                 //move the sound in 3d space
            }
            if (fireTime != 0)
            {
                if (Common.getRandom(1, 300) == 150)
                {
                    teleport();
                }
                if (Common.getRandom(1, 300) == 5)
                {
                    specialMove();
                }
                if (getPosition(Mission.player).distance >= 15.0)
                {
                    x = Mission.player.x - 3.0;
                    y = Mission.player.y + 3.0;
                    playTaunt(soundPath + "j2-"
                              + Common.getRandom(1, 3)
                              + ".wav");
                }
            }             //if can fire
            regenerate();
            base.move();
        }