//Constructor function. This shares the name of the class and its type is not defined here. public GameArea() { ship = new Ship(); ship.X = maxX; ship.Y = 1; AlienSwarm = new AlienSwarm(maxX, maxY); }
//Constructor function. This shares the name of the class and its type is not defined here. public GameArea() { Ship = new Ship(); Ship.X = maxX; Ship.Y = 1; AlienSwarm = new AlienSwarm(); }
/// <summary> /// Run a game turn, move aliens , move ship, move gun, detect collisions - destroy a collided with object. /// </summary> public void PlayTurn() { AlienSwarm.AlienSwarmMove(maxX); ship.ShipTurn(); if (Gun != null) { Gun.Move(); } var alien = CollisionAlienVsGun(); if (alien != null) { AlienSwarm.Aliens.Remove(alien); } if (CollisionShipVsAlien() == true) { } }