public GameController() { gameBoard = new GameBoard(); ScoreBoard.Initialize(0, 3, 1, "Peak Hours"); p = new PlayerVehicle(415, 570); p.SpeedX = 100; p.SpeedY = 100; p.Acceleration = 0; }
public void TestBonusStageObstacle() { GameController myGame = new GameController(); ScoreBoard.Initialize(0, 0, 5, "Peak Hours"); myGame.CurrentBoard.Stage = GameStage.BonusStage; myGame.AddObstacle(); Assert.AreEqual(ObstacleType.Score, myGame.CurrentBoard.Obstacles [0].GetObstacleType); }
public void TestSpawnVehicle() { GameBoard gb = new GameBoard(); PlayerVehicle p = new PlayerVehicle(415, 570); ScoreBoard.Initialize(0, 3, 1, "Peak Hours"); Car c = new Car(415, 20); gb.RandomSpawnVehicle(p, c); Assert.AreEqual(UtilityFunction.InitialY, c.Y); }
public void TestNagivate() { GameBoard gb = new GameBoard(); PlayerVehicle p = new PlayerVehicle(415, 570); ScoreBoard.Initialize(0, 0, 1, "Peak Hours"); //right p.SpeedX = 10000; p.SpeedY = 10000; SwinGame.Delay(20); p.UpdateTime(); p.NavigateRight(); Assert.AreEqual(GameController.startLane3X + 20, p.X); }
public void TestgameOver() { GameBoard gb = new GameBoard(); PlayerVehicle p = new PlayerVehicle(415, 570); ScoreBoard.Initialize(0, 0, 1, "Peak Hours"); Car c = new Car(415, 20); Lorry l = new Lorry(415, 20); Motorcycle m = new Motorcycle(415, 20); Fuel f = new Fuel(415, 20); Life lf = new Life(415, 20); Invisible i = new Invisible(415, 20); Score s = new Score(415, 20); Bomb b = new Bomb(415, 20); Turbo t = new Turbo(415, 20); if (gb.GameOver() == true) { ScoreBoard.Life = 3; ScoreBoard.Score = 1; } Assert.AreEqual(3, ScoreBoard.Life); }