I want to start by saying I did search first, and found a lot of similar issues on various other things, but not this problem exactly.
I have this code:
You need to rename your private gameOver variable. Change this:
bool gameOver = false;
public bool GameOver {
get { return gameOver; }
set { gameOver = value; }
}
to
bool _gameOver = false;
public bool GameOver {
get { return _gameOver; }
set { _gameOver = value; }
}
You can't use the same variable name in a single class.
Alternatively, assuming you're using a recent version of .Net, you could remove your private variable and just have:
public bool GameOver { get; set; }
Good luck.