private void pbNewGame_Click(object sender, EventArgs e) { //if(fPickPlayer == null) fPickPlayer = new frmPickPlayer(this); this.Hide(); fPickPlayer.Show(); }
void timer_Tick(object sender, EventArgs e) { if (playerOneIsRight != this.playerOneDirection()) { playerOneIsRight = this.playerOneDirection(); // ja azurira pozicijata ("SVRTENOSTA") na igracot // MessageBox.Show(playerOneIsRight + " "); if (playerOneIsRight) { playerOne.changeDirection(Direction.LEFT); playerTwo.changeDirection(Direction.RIGHT); } else { playerOne.changeDirection(Direction.RIGHT); playerTwo.changeDirection(Direction.LEFT); } } this.Moving(); this.update(); if (!playerOne.CheckAndActs()) { gameIsFinished = true; } if (!playerTwo.CheckAndActs()) { gameIsFinished = true; } // this.checkClashAndAct(); Invalidate(); if (gameIsFinished) { timer.Stop(); playAgainForm = new FrmPlayAgain(); if (playAgainForm.ShowDialog() == DialogResult.OK) { pickPlayerForm = new frmPickPlayer(MainForm); if(frmOptions.musicOn) { MainForm.wplayer.currentPlaylist = MainForm.playlistMenu; } else { MainForm.wplayer.controls.stop(); } pickPlayerForm.Show(); this.Hide(); } else { Application.Exit(); } } }
private void actOnEnter() { if (pickAForm == 0) { fPickPlayer = new frmPickPlayer(this); this.Hide(); fPickPlayer.Show(); } else if (pickAForm == 1) { if (fOptions == null) { fOptions = new frmOptions(this); } this.Hide(); fOptions.Show(); } else if (pickAForm == 2) { this.Close(); } }