public void OnStart() { GetScores(); IntroScreen ns = new IntroScreen(); this.Controls.Add(ns); }
private void MenuScreen_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e) { if (e.KeyCode == Keys.Down) { if (playIndex == 3) { playIndex = 0; } else { playIndex++; } } else if (e.KeyCode == Keys.Up) { if (playIndex == 0) { playIndex = 3; } else { playIndex--; } } else if (e.KeyCode == Keys.Space) { Form f = this.FindForm(); f.Controls.Remove(this); switch (playIndex) { case 0: StartScreen ss = new StartScreen(); f.Controls.Add(ss); f.Height -= 10; break; case 1: MinigameScreen ms = new MinigameScreen(); f.Height += 50; f.Controls.Add(ms); break; case 2: HighScoreScreen hs = new HighScoreScreen(); f.Controls.Add(hs); break; case 3: IntroScreen ns = new IntroScreen(); f.Controls.Add(ns); break; } } Refresh(); }