예제 #1
0
        public override void ViewDidLoad()
        {
            this.NavigationController.ToolbarHidden = true;
            level_up_text.Text  = "Level " + level.lvlnum + " complete!";
            rewardLabel.Text    = "Reward: " + level.reward.name;
            next.TouchUpInside += (object sender, EventArgs e) =>
            {
                if (game.ifOver())
                {
                    GameOverViewController go = this.Storyboard.InstantiateViewController("GameOver") as GameOverViewController;
                    go.game = game;
                    this.NavigationController.PushViewController(go, true);
                }

                else
                {
                    GameViewController theGame = this.Storyboard.InstantiateViewController("Game") as GameViewController;
                    theGame.game = game;
                    this.NavigationController.PushViewController(theGame, true);
                }
            };
            quit.TouchUpInside += (object sender, EventArgs e) =>
            {
                IndexViewController index = this.Storyboard.InstantiateViewController("Index") as IndexViewController;
                this.NavigationController.PushViewController(index, true);
            };
        }
        public override void ViewDidLoad()
        {
            this.NavigationController.ToolbarHidden = true;

            lifeLabel.Text = "Lives: " + game.lives;

            next.TouchUpInside += (object sender, EventArgs e) =>
            {
                if (game.ifOver())
                {
                    GameOverViewController go = this.Storyboard.InstantiateViewController("GameOver") as GameOverViewController;
                    go.game = game;
                    this.NavigationController.PushViewController(go, true);
                }
                else if (game.endLevel())
                {
                    LevelUpViewController lu = this.Storyboard.InstantiateViewController("LevelUp") as LevelUpViewController;
                    lu.game  = game;
                    lu.level = level;
                    this.NavigationController.PushViewController(lu, true);
                }
                else
                {
                    GameViewController theGame = this.Storyboard.InstantiateViewController("Game") as GameViewController;
                    theGame.game = game;
                    this.NavigationController.PushViewController(theGame, true);
                }
            };

            quit.TouchUpInside += (object sender, EventArgs e) =>
            {
                IndexViewController index = this.Storyboard.InstantiateViewController("Index") as IndexViewController;
                this.NavigationController.PushViewController(index, true);
            };
        }
예제 #3
0
        public override void ViewDidLoad()
        {
            this.NavigationController.ToolbarHidden = true;

            pointsLabel.Text = "+" + answer.points + " points!";

            //url = NSUrl.FromFilename ("Resources/Correct-answer.mp3");
            //systemSound = new SystemSound(url);
            //systemSound.PlayAlertSound();

            next.TouchUpInside += (object sender, EventArgs e) =>
            {
                if (game.ifOver())
                {
                    GameOverViewController go = this.Storyboard.InstantiateViewController("GameOver") as GameOverViewController;
                    go.game = game;
                    this.NavigationController.PushViewController(go, true);
                }
                else if (game.endLevel())
                {
                    LevelUpViewController lu = this.Storyboard.InstantiateViewController("LevelUp") as LevelUpViewController;
                    lu.game  = game;
                    lu.level = level;
                    this.NavigationController.PushViewController(lu, true);
                }
                else
                {
                    GameViewController theGame = this.Storyboard.InstantiateViewController("Game") as GameViewController;
                    theGame.game = game;
                    this.NavigationController.PushViewController(theGame, true);
                }
            };

            quit.TouchUpInside += (object sender, EventArgs e) =>
            {
                IndexViewController index = this.Storyboard.InstantiateViewController("Index") as IndexViewController;
                this.NavigationController.PushViewController(index, true);
            };
        }