Exemple #1
0
        /// <summary>
        /// Handles the keypresses and game state changes for the main menu
        /// </summary>
        public void MainMenuKeys()
        {
            if (currKeyboardState.IsKeyDown(Keys.Enter) && currKeyboardState != prevKeyboardState)
            {
                currState = State.instructions;
                if (currKeyboardState.IsKeyDown(Keys.Space))
                {
                    currState = State.quiz;
                    quiz = new Quiz(Content);
                }

            }
            else if (currKeyboardState.IsKeyDown(Keys.F1) && currKeyboardState != prevKeyboardState)
            {
                currState = State.highscores;
            }
            else if (currKeyboardState.IsKeyDown(Keys.F12) && currKeyboardState != prevKeyboardState)
            {
                currState = State.credits;
            }
        }
Exemple #2
0
        public void DrawInstructions()
        {
            spriteBatch.DrawString(instructionfont, "INSTRUCTIES", new Vector2(500, 150), Color.Black);
            spriteBatch.DrawString(instructionfont, "We beginnen met een quiz om je vaardigheden\nte testen\nOm een antwoord te geven druk je op\n1 = A\n2 = B\n3 = C \n \n\nNa de quiz begint de praktijk oefening\n\nVul hier uw naam in: ", new Vector2(500, 210), Color.Black);
            spriteBatch.Draw(TextBox, new Vector2(1100, 775), Color.White);
            spriteBatch.Draw(Button, InstructionStartButton, Color.White);

            spriteBatch.DrawString(usernameFont, username, new Vector2(1200, 825), Color.Black);
            spriteBatch.DrawString(font, "Start (Spatie)", new Vector2(950, 975), Color.Black);

            if (currKeyboardState.IsKeyDown(Keys.Space))
            {
                Database conn = new Database();
                conn.insertUser(username);
                currentUserId = (int) conn.getUserIdFromUserName(username);
                conn.close();
                currState = State.quiz;
                quiz = new Quiz(Content);
            }
        }