Skip to content

Instantly share code, notes, and snippets.

@ScottLilly ScottLilly/After.cs Secret
Last active Feb 27, 2018

Embed
What would you like to do?
New player code
else if (x == 1)
{
_player = Player.CreateDefaultPlayer();
}
// SCOTT'S NOTE: I don't know if these lines need to be inside the {} for the "else if".
// If they only need to run when x == 1, move them inside
//sets the image with introduction
lblPergament.BringToFront();
lblPergament.Visible = true;
else if (x == 1)
//sets the image with introduction
lblPergament.BringToFront();
lblPergament.Visible = true;
{
_player = Player.CreateDefaultPlayer();
}
else if (x == 1)
//sets the image with introduction
lblPergament.BringToFront(); // Because there is no { after the "else if", the program thinks this one line is the one to run when x == 1
lblPergament.Visible = true; // This line is outside the assumed {} for the "else if", so it always runs
{
// This {} block of code does not have an "if" or "else if", so it always runs
_player = Player.CreateDefaultPlayer();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.