private void StartGame(int level) { Clear(); State = GameState.CountDown; background = new Sprite(new Material(ShaderFlags.Position2DColoredTextured, "Background"), ScreenSpace.Scene.Viewport) { RenderLayer = int.MinValue }; ScreenSpace.Scene.ViewportSizeChanged += () => background.SetWithoutInterpolation(ScreenSpace.Scene.Viewport); //menuScene.SetViewportBackground("Background"); trees = new TreeManager(Team.HumanYellow); if (level == 1) { SetupLevel1Trees(); } else if (level == 2) { SetupLevel2Trees(); } else { SetupLevel3Trees(); } trees.GameFinished += SetGameOverState; trees.GameLost += SetGameOverState; }
private void StartGame(int level) { Clear(); State = GameState.CountDown; menuScene.SetViewportBackground("Background"); trees = new TreeManager(Team.HumanYellow); if (level == 1) SetupLevel1Trees(); else if (level == 2) SetupLevel2Trees(); else SetupLevel3Trees(); trees.GameFinished += SetGameOverState; trees.GameLost += SetGameOverState; }
private void StartGame(int level) { Clear(); State = GameState.CountDown; background = new Sprite(new Material(ShaderFlags.Position2DColoredTextured, "Background"), ScreenSpace.Scene.Viewport) { RenderLayer = int.MinValue }; ScreenSpace.Scene.ViewportSizeChanged += () => background.SetWithoutInterpolation(ScreenSpace.Scene.Viewport); //menuScene.SetViewportBackground("Background"); trees = new TreeManager(Team.HumanYellow); if (level == 1) SetupLevel1Trees(); else if (level == 2) SetupLevel2Trees(); else SetupLevel3Trees(); trees.GameFinished += SetGameOverState; trees.GameLost += SetGameOverState; }