Skip to content

Instantly share code, notes, and snippets.

@ScottLilly
Last active February 27, 2018 23:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ScottLilly/8516a40ec115b3c512da096e2cf8b8ea to your computer and use it in GitHub Desktop.
Save ScottLilly/8516a40ec115b3c512da096e2cf8b8ea to your computer and use it in GitHub Desktop.
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