Пример #1
0
        public override void Update(Controller.LevelController levelController)
        {
            if (!pushed)
            {
                pushed         = true;
                questionAction = new Phrase()
                {
                    text = question
                };
                levelController.GetDialogue().SetDialogue(questionAction);
            }

            if (selectedAnswer > -1)
            {
                answers[selectedAnswer].Complete(levelController.GetModel());
                isComplete = true;
                return;
            }

            if (questionAction.IsComplete())
            {
                UpDownMenu menu = UpDownMenu.FromQuestion(this, answerSelected);

                Game.questionScreen.SetMenu(menu);
                Game.GoToScreen(Game.questionScreen);
            }
        }
Пример #2
0
        public Game()
        {
#if DEBUG
            // set the logger 'sensitivity': In DEBUG compilation every Message should be logged.
            // in release compilation the normal 'sensitivity' LogPriority.MIDDLE is used.
            if (logger != null)
            {
                logger.Priority = LogPriority.DEBUG;
            }
#endif

            initLL();

            // Setup menu structure
            mainMenuModel = new UpDownMenu(() => GoToScreen(startScreen), new UpDownMenuItem[]
            {
                new UpDownMenuItem(startTutorial, ll.GetTrans("game.menu.tutorial")),
                new UpDownMenuItem(startNewGame, ll.GetTrans("game.menu.new")),
                new UpDownMenuItem(() => GoToScreen(loadMenuScreen), ll.GetTrans("game.menu.load")),
                new UpDownMenuItem(exitApplication, ll.GetTrans("game.menu.exit")),
            });

            pauseMenuModel = new UpDownMenu(() => GoToScreen(gameScreen), new UpDownMenuItem[]
            {
                new UpDownMenuItem(() => GoToScreen(gameScreen), ll.GetTrans("game.pause.resume")),
                new UpDownMenuItem(() => GoToScreen(saveMenuScreen), ll.GetTrans("game.pause.save")),
                new UpDownMenuItem(() => GoToScreen(mainMenuScreen), ll.GetTrans("game.pause.exit")),
            });

            saveMenuModel = new UpDownMenu(() => GoToScreen(pauseMenuScreen), new UpDownMenuItem[]
            {
                new UpDownMenuItem(() => saveGame(0), ll.GetTrans("game.save.savetoslot") + " 1"),
                new UpDownMenuItem(() => saveGame(1), ll.GetTrans("game.save.savetoslot") + " 2"),
                new UpDownMenuItem(() => saveGame(2), ll.GetTrans("game.save.savetoslot") + " 3"),
                new UpDownMenuItem(() => saveGame(3), ll.GetTrans("game.save.savetoslot") + " 4"),
                new UpDownMenuItem(() => saveGame(4), ll.GetTrans("game.save.savetoslot") + " 5"),
                new UpDownMenuItem(() => saveGame(5), ll.GetTrans("game.save.savetoslot") + " 6"),
            });

            loadMenuModel = new UpDownMenu(() => GoToScreen(mainMenuScreen), new UpDownMenuItem[]
            {
                new UpDownMenuItem(() => loadGame(0), ll.GetTrans("game.load.loadfromslot") + " 1"),
                new UpDownMenuItem(() => loadGame(1), ll.GetTrans("game.load.loadfromslot") + " 2"),
                new UpDownMenuItem(() => loadGame(2), ll.GetTrans("game.load.loadfromslot") + " 3"),
                new UpDownMenuItem(() => loadGame(3), ll.GetTrans("game.load.loadfromslot") + " 4"),
                new UpDownMenuItem(() => loadGame(4), ll.GetTrans("game.load.loadfromslot") + " 5"),
                new UpDownMenuItem(() => loadGame(5), ll.GetTrans("game.load.loadfromslot") + " 6"),
            });

            initializeTui();

            // Insert desired screen
            GoToScreen(startScreen);
        }