Create a gist now

Instantly share code, notes, and snippets.

@ScottLilly /SuperAdventure.cs Secret
Last active Dec 13, 2017

What would you like to do?
public naoiseRPG()
{
InitializeComponent();
DialogResult answer = MessageBox.Show(this, "Do you want to load a previous game?", "Load Game",
MessageBoxButtons.YesNo);
if(answer == DialogResult.Yes)
{
OpenFileDialog openFile = new OpenFileDialog();
openFile.Filter = "XML files (*.xml)|*.xml";
if(openFile.ShowDialog(this) == DialogResult.OK)
{
if (File.Exists(openFile.FileName))
{
Player = player.createPlayerFromXmlString(File.ReadAllText(PLAYER_DATA_FILE_NAME));
}
else
{
Player = player.createDefaultPlayer();
}
}
}
else
{
Player = player.createDefaultPlayer();
}
moveTo(Player._currentArea);
updatePlayerStats();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment