コード例 #1
0
        public override Boolean Activate(PlayerVerticalShooter player, GameTime gameTime)
        {
            Vector2 centerDir = new Vector2(0, -1.0f);

            double dirRadians = MathFunctions.RadiansFromDir(centerDir);

            dirRadians += random.NextDouble() * 2 * Math.PI / 12 - Math.PI / 12;

            YellowBullet bullet = new YellowBullet(Game, spriteSheet);

            bullet.Position  = player.Position;
            bullet.Direction = MathFunctions.DirFromRadians(dirRadians);
            bullet.Initialize();

            bullet.SetSpreadSpeed(random);

            Game.stateManager.shooterState.gameObjects.Add(bullet);
            return(true);
        }
コード例 #2
0
        private void Setup()
        {
            Name = "Spread Bullet";
            Kind = "Primary";
            energyCostPerSecond = 6f;
            delay            = 14;
            Weight           = 500;
            ActivatedSoundID = SoundEffects.ClickLaser;
            displaySprite    = Game.spriteSheetItemDisplay.GetSubSprite(new Rectangle(200, 0, 100, 100));

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

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

            Value         = 300;
            Tier          = TierType.Average;
            numberOfShots = 1;
        }