コード例 #1
0
ファイル: Laser.cs プロジェクト: ruairitobrien/Nathaniel-WP7
 public Laser(GameplayScreen gameplayScreen, GameCharacter owner)
     : base(gameplayScreen, owner)
 {
     beam = new BasicPrimitives(gamePlayScreen.ScreenManager.GraphicsDevice);
     //Default beam colour can be changed with public property
     LaserColour = new Color(255, 255, 255, 180);
     LaserThickness = 2;
     coolDownTime = 3.5;
     coolDownElapsed = 0;
     burstDuration = 1.5;
     dps = 20;
 }
コード例 #2
0
 public static void AddEnemy(GameplayScreen gameplayScreen, string name, Vector2 position, GameCharacter target)
 {
     if(name.StartsWith("Gr"))
     {
         var g = new Grunt(gameplayScreen){Center = position};
         g.Initialize();
         g.Name = name;
         if(target != null)
         g.Target = target;
         _enemies.Add(g);
     }
     else if(name.StartsWith("So"))
     {
         var m = new Soldier(gameplayScreen) { Center = position };
         m.Initialize();
         m.Name = name;
         m.Target = target;
         _enemies.Add(m);
         NumSoldiers += 1;
     }
     else if(name.StartsWith("Sp"))
     {
         var s = new Spawner(gameplayScreen) { Center = position };
         s.Initialize();
         s.Name = name;
         s.Target = target;
         _enemies.Add(s);
     }
     else if(name.StartsWith("Bo"))
     {
         _boss = new Boss(gameplayScreen) { Center = position };
         _boss.Initialize();
         _boss.Name = name;
         NumBosses++;
         _boss.Target = target;
         _enemies.Add(_boss);
         _boss.Died += new DeathEventHandler(_boss_Died);
     }
 }
コード例 #3
0
 protected ProjectileWeapon(GameplayScreen gameplayScreen, GameCharacter owner)
     : base(gameplayScreen, owner)
 {
     ammo = new List<Projectile>();
 }