//LoadGame private void button1_Click(object sender, EventArgs e) { foreach (Playerstats player in players) { if (player.Name == comboBox1.Text) { TheGame game = new TheGame(player); this.Hide(); comboBox1.Text = ""; game.ShowDialog(); break; } } this.Show(); comboBox1.Items.Clear(); Menu_Load(null, null); }
private void BtnNewPlayer_Click(object sender, EventArgs e) { switch (comboBox1.SelectedIndex) { case 1: player.Def = 20; player.Dmg = 10; player.Speed = 1; player.Resistance = 0; break; case 2: player.Def = 10; player.Dmg = 20; player.Speed = 2; player.Resistance = 10; break; case 3: player.Def = 0; player.Dmg = 30; player.Speed = 1; player.Resistance = 20; break; } player.Hp = 200; player.Name = tbname.Text; player.LocationX = 0; player.LocationY = 19; player.Exp = 0; player.Exptonext = 100; player.Dmg = 0; dbc.luohahmo(player); TheGame game = new TheGame(player); game.ShowDialog(); this.Close(); }