public static QuestionGameObject CreateQuestion(RunnerLevel level, QuestionSubject subject, Renderer3D renderer, List <CollidableGameObject> collidableObjects, List <QuestionGameObject> existingQuestions)
        {
            Question q = null;

            switch (subject)
            {
            case (QuestionSubject.PT):
                q = GenerateQuestion((int)level, existingQuestions, QuestionsDatabase.PT_Questions);
                break;

            default:
                q = GenerateQuestion((int)level, existingQuestions, QuestionsDatabase.MAT_Questions);
                break;
            }
            return(new QuestionGameObject(renderer, collidableObjects, q));
        }
示例#2
0
        void subjectBtn_mouseClicked(Button btn)
        {
            if (btn != math)
            {
                math.State = ButtonStates.NORMAL;
            }
            else
            {
                chosenSubjects = new QuestionSubject[] { QuestionSubject.MAT }
            };

            if (btn != pt)
            {
                pt.State = ButtonStates.NORMAL;
            }
            else
            {
                chosenSubjects = new QuestionSubject[] { QuestionSubject.PT }
            };

            if (btn != both)
            {
                both.State = ButtonStates.NORMAL;
            }
            else
            {
                chosenSubjects = new QuestionSubject[] { QuestionSubject.MAT, QuestionSubject.PT }
            };
        }

        void difficultyBtn_mouseClicked(Button btn)
        {
            if (btn != easy)
            {
                easy.State = ButtonStates.NORMAL;
            }
            else
            {
                chosenLevel = RunnerLevel.EASY;
            }

            if (btn != medium)
            {
                medium.State = ButtonStates.NORMAL;
            }
            else
            {
                chosenLevel = RunnerLevel.MEDIUM;
            }

            if (btn != hard)
            {
                hard.State = ButtonStates.NORMAL;
            }
            else
            {
                chosenLevel = RunnerLevel.HARD;
            }
        }

        void play_mouseClicked(Button btn)
        {
            if (parent.IsActive)
            {
                goToState = StatesIdList.RUNNER;
            }
        }

        void maria_mouseClicked(Button btn)
        {
            if (parent.IsActive)
            {
                selected    = SelectedCharacter.MARIA;
                cosme.State = ButtonStates.NORMAL;
            }
        }

        void cosme_mouseClicked(Button btn)
        {
            if (parent.IsActive)
            {
                selected    = SelectedCharacter.COSME;
                maria.State = ButtonStates.NORMAL;
            }
        }

        void titleScreen_mouseClicked(Button btn)
        {
            if (parent.IsActive)
            {
                goToState = StatesIdList.MAIN_MENU;
                AudioManager.GetCue("cancel2").Play();
            }
        }
示例#3
0
        protected override void Initialize()
        {
            if (!initialized)
            {
                base.Initialize();
                level    = RunnerLevel.EASY;
                subjects = new QuestionSubject[] { QuestionSubject.PT };
                Score    = 0;
                perfectScoreMultiplier = 2;

                enterTransitionDuration = 500;
                exitTransitionDuration  = 1000;

                showTutorial = true;

                shouldWait = true;

                goBackTo = StatesIdList.EMPTY_STATE;

                questions = new List <QuestionGameObject>();

                questionHeader               = new TextBox(goManager.R2D);
                questionHeader.FontSize      = 60;
                questionHeader.TextColor     = new Color(245, 236, 222);
                questionHeader.Outline       = true;
                questionHeader.OutlineColor  = new Color(111, 129, 129);
                questionHeader.OutlineWeight = 2;
                questionHeader.Alignment     = TextAlignment.CENTER;
                questionHeader.Width         = 1024;
                questionHeader.Height        = 100;
                questionHeader.Y             = 5;

                string path = "Imagem" + Path.AltDirectorySeparatorChar + "ui" + Path.AltDirectorySeparatorChar + "bate_bola" +
                              Path.AltDirectorySeparatorChar + "respostas_e_pontos" + Path.AltDirectorySeparatorChar;

                answersSupports              = new Repeatable2DGameObject(goManager.R2D, path, "suporte", 2, -1);
                answersSupports.Y            = 100;
                answersSupports.RepeatAmount = Vector2.Zero;
                answersSupports.AdaptToFrame = false;

                answersGotLbl = new List <TextBox>();

                numberOfQuestions = 1;

                ball = new Ball(goManager.R3D, goManager.CollidableGameObjects);

                player = new Character(goManager.R3D, goManager.CollidableGameObjects, "cosme", ball);
                player.collidedWithAnswer += new Character.CollidedWithAnswer(player_collidedWithAnswer);

                cam = new Camera(new Vector3(0f, 3f, -4f), Vector3.Up, new Vector2(0.25f, 20f));
                cam.lookAt(new Vector3(0f, 0.25f, 2f), true);
                cam.createProjection(MathHelper.PiOver4, parent.GraphicsDevice.Viewport.AspectRatio);
                goManager.R3D.Cam = cam;

                bg    = new Background(goManager.R2D);
                field = new Field(goManager.R3D, rows, columns);

                progress             = new ProgressBar(goManager.R2D);
                progress.Orientation = BarOrientation.VERTICAL;

                char   separator = Path.AltDirectorySeparatorChar;
                string uiPath    = "Imagem" + separator + "ui" + separator;

                progress.FilePath    = uiPath + "progress_bar";
                progress.FillOpacity = 0.75f;

                uiPath  += "bate_bola" + separator;
                scoreLbl = new TextBox(goManager.R2D);
                scoreLbl.BaseFileName = "pontos";
                scoreLbl.FilePath     = uiPath + "respostas_e_pontos" + separator;
                scoreLbl.FontSize     = 30;
                scoreLbl.Alignment    = TextAlignment.CENTER;
                scoreLbl.Width        = 219;
                scoreLbl.Height       = 60;
                scoreLbl.X            = parent.GraphicsDevice.Viewport.Width - scoreLbl.Width - 5;
                scoreLbl.Padding      = new Vector4(0, scoreLbl.Height * 0.4f, 0, 0);

                mistakesLbl = new TextBox(goManager.R2D);
                mistakesLbl.BaseFileName = "erros";
                mistakesLbl.FontSize     = 30;
                mistakesLbl.Alignment    = TextAlignment.CENTER;
                mistakesLbl.FilePath     = uiPath + "respostas_e_pontos" + separator;
                mistakesLbl.Width        = 219;
                mistakesLbl.Height       = 60;
                mistakesLbl.X            = scoreLbl.X;
                mistakesLbl.Padding      = new Vector4(0, mistakesLbl.Height * 0.4f, 0, 0);


                bgmNames = new string[] { "wedo_midi", "vanilla", "relaxing_summer_bea", "quotsports_fanaticq" };

                totalLoadingSteps  = 6;
                currentLoadingStep = 0;

                goManager.AddObject(cam);
                goManager.AddObject(bg);
                goManager.AddObject(field);
                goManager.AddObject(ball);
                goManager.AddObject(player);
                goManager.AddObject(progress);
                goManager.AddObject(questionHeader);
                goManager.AddObject(answersSupports);
                goManager.AddObject(scoreLbl);
                goManager.AddObject(mistakesLbl);
            }
        }