private void CodeGame_FormClosing(object sender, FormClosingEventArgs e) { Moving.Position position = new Moving.Position(pbPlayer.Location); Moving.PosSaveFile posSaveFile = new Moving.PosSaveFile(); posSaveFile.Save(position); Moving.RotateFileSave rotateSave = new Moving.RotateFileSave(); rotateSave.Save(rotateSave.Load()); Launcher.MyForm.Close(); }
public CodeGame() { InitializeComponent(); Moving.RotateFileSave rotatef = new Moving.RotateFileSave(); Moving.Rotate rotate = new Moving.Rotate(); rotate = rotatef.Load(); label1.Text = $"Top : {rotate.isTop}\nLeft : {rotate.isLeft}\nRight : {rotate.isRight}\nDown : {rotate.isBack}"; lastPos = new Point(); MyForm = this; GeneratePlayerPosition generatePlayerPosition = new GeneratePlayerPosition(); generatePlayerPosition.GenerateRandomPosition(); }