コード例 #1
0
ファイル: Level.cs プロジェクト: va-14/kb24subby
        private void ChopperGenerator()
        {
            if (TotalRoundTime >= _spawnChopperSecond)
            {
                Random random = new Random();
                _spawnChopperSecond = random.Next(_spawnChopperSecond + 3, _spawnChopperSecond + 7);
                Chopper chopper = new Chopper() {
                    Texture = _chopperTexture,
                    Color = Color.White,
                    Position = new Vector2(ScrollingPosition-70, 60),
                    Speed = 6f,
                    TextureName = "chopper",
                    DropSecond = random.Next(0, 5),
                    Health = 200
                };
                chopper.Missiles = new List<Missile>(){
                    CreateMissile(new Missile(), new Point(-40,0), 300),
                    CreateMissile(new Missile(), new Point(-40,0), 300)
                    };

                SpriteList.Add(chopper);
            }
        }
コード例 #2
0
ファイル: ChopperTest .cs プロジェクト: va-14/kb24subby
        public void setup()
        {
            missile = new Missile()
            {
                Damage = 300,
                Active = true,
                Speed = 3f,
                Exploded = false,
                Position = new Vector2(0, 0)
            };
            chopper = new Chopper()
            {
                Health = 300,
                Speed = 2f,
                Position = new Vector2 (20,20)
            };

            level = new Level();
        }