public void StartGame() { mainMenu.Hide(); Show(); controls = new Controls(this); score = 0; GameState = GameState.Playing; InteractionLogic.BeginGame(); SetUpEvents(); controls.SetControlsToState(GameState); HudInterface = new HudInterface(); }
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>(); }