private void InitializeMainGame() { game = new MainGame(); game.OnCheckGameInputs += new MainGameEvent(game_OnCheckGameInputs); game.BeforeRedraw += new MainGameEvent(game_BeforeRedraw); if (game.Stage != null) { game.Stage.State = StageState.Loading; } game.StartGame(pictureBox1); }
private void btnNew_Click(object sender, EventArgs e) { var playerName = txtName.Text; if (!string.IsNullOrEmpty(playerName) && !string.IsNullOrWhiteSpace(playerName)) { var introString = MainGame.StartGame(playerName, true); //Open Class Choice Form this.Hide(); using (frmClassSelection classSelection = new frmClassSelection(MainGame, introString)) { classSelection.ShowDialog(); } this.Close(); } else { //If the player cleared out the name field, give them an error message. MessageBox.Show("Please Enter a Valid Name"); } }
static void Main() { // init the game below this MainGame game = new MainGame(); OpeningGameScene.ArtTitle(); game.StartGame(); game.EndGame(); var items = new Item(); EndingGameScene.EndTitle(); }
void SettingStartButton() { StartButton = GameObject.Find("StartBtn").GetComponent <Button>(); StartButton.onClick.AddListener(delegate { MainGame.StartGame(); }); StartButton.gameObject.SetActive(false); }