Esempio n. 1
0
        /// <summary>
        /// Button START
        /// Sets new player name and proceeds with introducing the player to the game.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ButtonStart_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                this.PlayerName            = this.NewGameName.Text;
                this.gameEngine.PlayerName = this.PlayerName;

                // Initializes the game
                this.gameEngine.Initialize();

                // New Game intro >>

                TriggerIntroAction continueAction = delegate()
                {
                    MainMenu.SwitchWindowContent(new GameMap(this.gameEngine), true);
                };

                MainMenu.SwitchWindowContent(new Intro("main_intro.jpg", "Chepelar Man is an outstanding logger who proved himself numerous times at Grizzly and Canidae forests with his agility and strength. Now he has to face the new threat that is about to endanger the livelihoods and lives of many. Will he make it out to the end? ...", continueAction), true);
            }
            catch (ArgumentException ex)
            {
                MessageBox.Show(ex.Message, "Invalid name");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Fatal error");
            }
        }
Esempio n. 2
0
        public Intro(string background, string description, TriggerIntroAction currentAction)
        {
            InitializeComponent();

            this.SetBackground(background);
            this.SetDescription(description);

            this.action = currentAction;
        }
Esempio n. 3
0
        /// <summary>
        /// LOCATION
        /// Executes on every location click.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Location_Click(object sender, RoutedEventArgs e)
        {
            Button location = (Button)sender;

            string locationText = location.Name.ToString().Remove(0, 8);

            TriggerIntroAction continueAction = delegate()
            {
                MainMenu.SwitchWindowContent(new Battle(locationText), true);
            };

            MainMenu.SwitchWindowContent(new Intro("battle_intro.jpg", String.Concat("Heading to ", locationText, " for battle..."), continueAction), true);
        }