I'm making a simple game where you fly the ship around, dodging asteroids until they hit you and you blow up. I have a form for the game, and then when you get hit after 5 seconds (I'm using a timer) it will tick closing that form and opening a new form (EndGameForm). I'll show my code, but there seems to be a failure and my knowledge in C# is very limited.
private void GameEndTimer_Tick(object sender, EventArgs e)
{
this.Visible = false;
EndGameForm gform = new EndGameForm();
gform.Show();
GameEndTimer.Enabled = false;
var frm2 = new EndGameForm(ScoreLabel.Text.ToString());
frm2.Show();
}
That was in the first form, saving the text from the score label and opening the new form.
public EndGameForm(string s)
{
InitializeComponent();
Score1Label.Text = s;
}
That was in the second form, recalling the save and setting the new Highscore label.
Error Code: Error 1 'SemesterProject.EndGameForm' does not contain a constructor that takes 0 arguments \HHS-FS2\Home$\Students\10th Grade\985832\CP C#\SemesterProject\SemesterProject\GameForm.cs 82 33 SemesterProject