Example #1
0
		public void StartGame()
		{
			IsActive = true;
			mainMenu.Hide();
			if (backToMenuCommand != null && backToMenuCommand.IsActive)
				backToMenuCommand.Dispose(); //ncrunch: no coverage
			if (gameOverMessage != null)
				gameOverMessage.Dispose(); //ncrunch: no coverage
			interact = new InteractionLogics();
			enemyTexture = new Material(ShaderFlags.Position2DColoredTextured, "EnemyPlane");
			player = new PlayerPlane(new Vector2D(ScreenSpace.Current.Viewport.Left + 0.08f, 0.5f));
			controls = new PlayerControls(player);
			background = new ParallaxBackground(4, layerImageNames, layerScrollFactors);
			background.BaseSpeed = 0.2f;
			player.Destroyed += DisplayGameOverMessage;
			Start<EnemySpawner>();
		}
Example #2
0
 public void StartGame()
 {
     IsActive = true;
     mainMenu.Hide();
     if (backToMenuCommand != null && backToMenuCommand.IsActive)
     {
         backToMenuCommand.Dispose();                 //ncrunch: no coverage
     }
     if (gameOverMessage != null)
     {
         gameOverMessage.Dispose();                 //ncrunch: no coverage
     }
     interact             = new InteractionLogics();
     enemyTexture         = new Material(ShaderFlags.Position2DColoredTextured, "EnemyPlane");
     player               = new PlayerPlane(new Vector2D(ScreenSpace.Current.Viewport.Left + 0.08f, 0.5f));
     controls             = new PlayerControls(player);
     background           = new ParallaxBackground(4, layerImageNames, layerScrollFactors);
     background.BaseSpeed = 0.2f;
     player.Destroyed    += DisplayGameOverMessage;
     Start <EnemySpawner>();
 }