예제 #1
0
파일: Game.cs 프로젝트: whztt07/DeltaEngine
		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>();
		}
예제 #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>();
 }