Ejemplo n.º 1
0
        public void Update()
        {
            switch (state)
            {
            default:
            case State.idle:
                if (idleBlinkTimer <= 0)
                {
                    Blink();
                }
                else
                {
                    idleBlinkTimer--;
                }
                break;

            case State.talk:
                if (talkTimer <= 0)
                {
                    state          = State.idle;
                    textureCurrent = textureIdle;
                }
                else
                {
                    talkTimer--;
                    talkLipFlapTimer--;
                    if (talkLipFlapTimer <= 0)
                    {
                        if (talkingState == Talking.closed)
                        {
                            textureCurrent = textureTalk1;
                            talkingState   = Talking.open;
                        }
                        else
                        {
                            textureCurrent = textureTalk2;
                            talkingState   = Talking.closed;
                        }
                        talkLipFlapTimer = talkLipFlapTimerStart;
                    }
                }
                if (currentmessagePosition < currentmessageLength)
                {
                    currentmessage.Append(message[currentmessagePosition]);
                    currentmessagePosition++;
                    textwindow.message = currentmessage.ToString();
                }
                break;
            }

            if (textwindow != null)
            {
                textwindow.Update();
            }
        }
Ejemplo n.º 2
0
        public override void Update(GameTime gameTime)
        {
            KeyboardState KeyboardState = Keyboard.GetState();

            if (KeyboardState.IsKeyDown(Keys.Enter) && !previousKeyboardState.IsKeyDown(Keys.Enter))
            {
                MediaPlayer.IsRepeating = false;
                MediaPlayer.Stop();
                GameStateManager.Instance.ChangeScreen(new TitleScreen(graphicsDevice, game));
            }

            character.Update();
            albumart.Update();

            if (windowText != null)
            {
                windowText.Update();
            }

            previousKeyboardState = KeyboardState;
        }