Exemplo n.º 1
0
 /// <summary>
 /// AlienSquad's constructor.
 /// </summary>
 /// <param name="game">The game it is attached to.</param>
 /// <param name="bomb">The bombs dropped by the aliens.</param>
 public AlienSquad(Game1 game, BombFactory bomb, LaserFactory laser)
     : base(game)
 {
     this.game = game;
     this.bomb = bomb;
     laser.AlienKilled += onAlienHit;
 }
Exemplo n.º 2
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (Game1 game = new Game1())
     {
         game.Run();
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// constructor for the alienSquad which are rows of aliens
 /// </summary>
 /// <param name="game"></param>
 public AlienSquad(Game1 game, int numAliens, BombFactory bombFactory)
     : base(game)
 {
     this.game = game;
     this.numAlien = numAliens;
     squads = new AlienSprite[numAlien, 12];
     this.bombFactory = bombFactory;
 }
Exemplo n.º 4
0
 /// <summary>
 /// AlienSprite's constructor. Creates an alien with an image,
 /// starting at the specified position.
 /// </summary>
 /// <param name="game">The game it is attached to.</param>
 /// <param name="imageAlien">The image representing the alien.</param>
 /// <param name="positionX">The X position of the alien.</param>
 /// <param name="positionY">The Y position of the alien.</param>
 public MotherShipSprite(Game1 game,BombFactory bomb, LaserFactory laser)
     : base(game)
 {
     this.game = game;
     this.bomb = bomb;
     this.Point = 100;
     laser.MotherShipHit += onShipHit;
     AlienSquad.NewWave += onNewWave;
 }
Exemplo n.º 5
0
 public ProjectileSprite(Game1 game, Vector2 start, Texture2D imageBullet, Vector2 velocity, ScoreSprite score)
     : base(game)
 {
     this.game = game;
     this.start = start;
     this.imageBullet = imageBullet;
     this.velocity = velocity;
     this.over = score;
     // TODO: Construct any child components here
 }
Exemplo n.º 6
0
 /// <summary>
 /// The BombFactory's constructor.
 /// </summary>
 /// <param name="game">The game it is attached to.</param>
 public BombFactory(Game1 game, Texture2D imageProjectile, int damage,
                    float velocity)
     : base(game)
 {
     this.game = game;
     this.imageProjectile = imageProjectile;
     AlienSquad.NewWave += onNewWave;
     this.damage = damage;
     this.velocity = velocity;
 }
Exemplo n.º 7
0
 /// <summary>
 /// AlienSprite's constructor. Creates an alien with an image,
 /// starting at the specified position.
 /// </summary>
 /// <param name="game">The game it is attached to.</param>
 /// <param name="imageAlien">The image representing the alien.</param>
 /// <param name="positionX">The X position of the alien.</param>
 /// <param name="positionY">The Y position of the alien.</param>
 public AlienSprite(Game1 game, Texture2D imageAlien, int positionX,
                    int positionY, int point)
     : base(game)
 {
     this.game = game;
     this.imageAlien = imageAlien;
     this.positionX = positionX;
     this.positionY = positionY;
     this.Point = point;
 }
Exemplo n.º 8
0
 /// <summary>
 /// ScoreSprite's constructor.
 /// </summary>
 /// <param name="game">The game</param>
 public ScoreSprite(Game1 game, LaserFactory laser, BombFactory bomb,
                    BombFactory motherShipBomb, BombFactory bonusBomb)
     : base(game)
 {
     this.game = game;
     bomb.PlayerHit += onPlayerHit;
     motherShipBomb.PlayerHit += onPlayerHit;
     bonusBomb.PlayerHit += onPlayerHit;
     laser.AlienKilled += onAlienHit;
     laser.MotherShipHit += onAlienHit;
     AlienSquad.NewWave += onNewWave;
 }
Exemplo n.º 9
0
 static void Main()
 {
     using (var game = new Game1())
         game.Run();
 }
Exemplo n.º 10
0
 /// <summary>
 /// ProjectileFactory's constructor.
 /// </summary>
 /// <param name="game"></param>
 public ProjectileFactory(Game1 game)
     : base(game)
 {
     this.game = game;
     AlienSquad.NewWave += onNewWave;
 }
Exemplo n.º 11
0
 /// <summary>
 /// LaserFactory's constructor.
 /// </summary>
 /// <param name="game">The game it is attached to.</param>
 public LaserFactory(Game1 game)
     : base(game)
 {
     this.game = game;
 }
Exemplo n.º 12
0
 /// <summary>
 /// Creates a bonus with a specified bomb.
 /// </summary>
 /// <param name="game">The game</param>
 /// <param name="bomb">Its bomb</param>
 public Bonus(Game1 game, BombFactory bomb)
     : base(game)
 {
     this.game = game;
     this.bomb = bomb;
 }
Exemplo n.º 13
0
 //private List<Buncker> bunker;
 public ProjectileFactory(Game1 game)
     : base(game)
 {
     this.game = game;
 }
Exemplo n.º 14
0
 /// <summary>
 /// PlayerSprite's constructor.
 /// </summary>
 /// <param name="game">The game it is attached to.</param>
 /// <param name="laser">The player's laser.</param>
 public PlayerSprite(Game1 game, LaserFactory laser)
     : base(game)
 {
     this.game = game;
     this.laser = laser;
 }
Exemplo n.º 15
0
 public BombFactory(Game1 game)
     : base(game)
 {
     this.game = game;
 }
Exemplo n.º 16
0
 public ScoreSprite(Game1 game)
     : base(game)
 {
     this.game = game;
 }