private void End_Paint() { if (game.EndCheck(current, canvus)) { current.MoveUP(); label2.Text = "游戏结束"; timer1.Enabled = false; } }
/// <summary> /// 结束游戏 /// </summary> private void End_Paint() { if (lgame.EndCheck(lcurrent, lcanvus) || rgame.EndCheck(rcurrent, rcanvus)) { lcurrent.MoveUP(); rcurrent.MoveUP(); timer1.Enabled = false; label3.Text = "游戏结束!~"; MessageBox.Show("游戏结束!请输入玩家姓名!"); string lgamer = Interaction.InputBox("该玩家分数为" + lscore.ToString(), "请输入左边玩家昵称", "玩家昵称", -1, -1); string rgamer = Interaction.InputBox("该玩家分数为" + rscore.ToString(), "请输入右边玩家昵称", "玩家昵称", -1, -1); DatabaseConnect newcon = new DatabaseConnect(); MySqlConnection con = newcon.Getcon(); newcon.Insertdata(con, newcon.insertdata, lgamer, lscore.ToString(), DateTime.Now.ToString()); newcon.Insertdata(con, newcon.insertdata, rgamer, rscore.ToString(), DateTime.Now.ToString()); newcon.Closeconnect(con); } }