コード例 #1
0
        public override Boolean Activate(PlayerVerticalShooter player, GameTime gameTime)
        {
            BasicLaser laser1 = new BasicLaser(Game, spriteSheet);

            laser1.PositionX = player.PositionX;
            laser1.PositionY = player.PositionY;

            BasicBulletSetup(laser1);
            Game.stateManager.shooterState.gameObjects.Add(laser1);
            return(true);
        }
コード例 #2
0
        private void Setup()
        {
            Name = "Field Damage";
            Kind = "Secondary";
            energyCostPerSecond = 0f;
            delay            = 800;
            Weight           = 400;
            ActivatedSoundID = SoundEffects.SmallLaser;
            displaySprite    = Game.spriteSheetItemDisplay.GetSubSprite(new Rectangle(200, 100, 100, 100));

            bullet = new BasicLaser(Game, spriteSheet);
            bullet.Initialize();

            damage   = Bullet.Damage;
            duration = Bullet.Duration;
            speed    = Bullet.Speed;

            Value         = 500;
            Tier          = TierType.Great;
            numberOfShots = 1;
        }
コード例 #3
0
        private void Setup()
        {
            Name = "Dual Laser";
            Kind = "Primary";
            energyCostPerSecond = 5.5f;
            delay            = 300;
            Weight           = 200;
            ActivatedSoundID = SoundEffects.SmallLaser;
            displaySprite    = Game.spriteSheetItemDisplay.GetSubSprite(new Rectangle(100, 0, 100, 100));

            bullet = new BasicLaser(Game, spriteSheet);
            bullet.Initialize();

            damage   = Bullet.Damage;
            duration = Bullet.Duration;
            speed    = Bullet.Speed;

            Value         = 200;
            Tier          = TierType.Average;
            numberOfShots = 2;
        }
コード例 #4
0
        private void Setup()
        {
            Name = "Burster";
            Kind = "Primary";
            energyCostPerSecond = 12f;
            delay            = 400;
            Weight           = 500;
            ActivatedSoundID = SoundEffects.BigLaser;
            displaySprite    = Game.spriteSheetItemDisplay.GetSubSprite(new Rectangle(700, 0, 100, 100));

            bullet = new BasicLaser(Game, spriteSheet);
            bullet.Initialize();

            damage   = Bullet.Damage;
            duration = Bullet.Duration;
            speed    = Bullet.Speed;

            Value         = 900;
            Tier          = TierType.Great;
            numberOfShots = 12;
        }
コード例 #5
0
        public override Boolean Activate(PlayerVerticalShooter player, GameTime gameTime)
        {
            Vector2 centerDir = new Vector2(0, -1.0f);
            double  spread    = Math.PI / 8;

            for (int n = 0; n < numberOfShots; n++)
            {
                BasicLaser bullet = new BasicLaser(Game, spriteSheet);
                bullet.PositionX = player.PositionX;
                bullet.PositionY = player.PositionY;

                bullet.Direction = MathFunctions.SpreadDir(centerDir, spread);
                bullet.Initialize();
                bullet.Duration *= 0.8f;
                bullet.Speed    *= 1f;
                bullet.Damage   *= 0.7f;

                bullet.SetSpreadSpeed(random);

                Game.stateManager.shooterState.gameObjects.Add(bullet);
            }

            return(true);
        }