コード例 #1
0
        public override Boolean Activate(PlayerVerticalShooter player, GameTime gameTime)
        {
            Vector2 centerDir   = new Vector2(0, -1.0f);
            double  longSpread  = Math.PI / 16;
            double  shortSpread = Math.PI / 3;

            for (int n = 0; n < longShotCount; n++)
            {
                FlameShot shot = new FlameShot(Game, spriteSheet);
                shot.PositionX = player.PositionX;
                shot.PositionY = player.PositionY;

                shot.Direction = MathFunctions.SpreadDir(centerDir, longSpread);
                shot.Initialize();
                shot.SetSpreadSpeed(random, 0.2f);
                Game.stateManager.shooterState.gameObjects.Add(shot);
            }

            for (int n = 0; n < shortShotCount; n++)
            {
                FlameShot shot = new FlameShot(Game, spriteSheet);
                shot.PositionX = player.PositionX;
                shot.PositionY = player.PositionY;

                shot.Direction = MathFunctions.SpreadDir(centerDir, shortSpread);
                shot.Initialize();
                shot.Speed *= 0.3f;
                shot.SetSpreadSpeed(random, 0.2f);
                Game.stateManager.shooterState.gameObjects.Add(shot);
            }

            return(true);
        }
コード例 #2
0
        private void Setup()
        {
            Name = "Flame Shot";
            Kind = "Primary";
            energyCostPerSecond = 10f;
            delay            = 500;
            Weight           = 100;
            ActivatedSoundID = SoundEffects.MuffledExplosion;

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

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

            Value = 800;
            Tier  = TierType.Good;

            numberOfShots = longShotCount + shortShotCount;
        }