public NewGameForm(SnakeMainForm owner) { InitializeComponent(); this.ownerForm = (SnakeMainForm)owner; ConfigureFormControls(); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); snakeMainForm = new SnakeMainForm(); Application.Run(snakeMainForm); }
public FormGameOver(SnakeMainForm ownerForm) { InitializeComponent(); this.ownerForm = ownerForm; this.labelResult.Text = ownerForm.TheSnake.SnakeBody.Count.ToString(); this.labelChangedDirection.Text = ownerForm.TheSnake.ChangedDirectionCount.ToString(); this.labelSpeed.Text = ownerForm.Speed[ownerForm.TheSnake.SnakeTimer.Interval]+"F/Sec"; this.labelField.Text = ownerForm.GamePlatform.Rows + " X " + ownerForm.GamePlatform.Colums; this.labelScore.Text = this.GameScore.ToString(); this.textBoxPlayerName.Text = SnakeClassicGUI.Properties.Game.Default.PlayerName; this.buttonNewGame.Click+=new EventHandler(buttonClose_Click); this.buttonNewGame.Click += new EventHandler(this.ownerForm.newGameToolStripMenuItem_Click); CurrentResult = new Result(this.GameScore,ownerForm.TheSnake.SnakeBody.Count, ownerForm.Speed[ownerForm.TheSnake.SnakeTimer.Interval] + "F/Sec", ownerForm.FieldSize[ownerForm.FieldSizeIndex], ownerForm.IncludeBorderIndex); DisplayPlace(); Result.DisplayResults(dataGridViewResult, 5); labelAllRecNumber.Text = "All records:" + Result.AllRecordsNumber().ToString(); }
public FormColors(SnakeMainForm ownerForm) { InitializeComponent(); this.ownerForm = ownerForm; this.Paint += new PaintEventHandler(FormColors_Paint); }
public UserControls(SnakeMainForm currentForm) { this.currentForm = currentForm; this.currentForm.KeyDown+=new KeyEventHandler(currentForm_KeyDown); }