Beispiel #1
0
 private void OpenDoor(GameTime gameTime)
 {
     door.SetIMG(1);
     cat.DisplayingID = 0;
     IntervalSpan2    = SceneStart;
     doorOpening      = true;
 }
Beispiel #2
0
        void Update_3(GameTime gameTime)
        {
            _gameTime = gameTime;
            foreach (var item in components)
            {
                item.Update(gameTime);
            }
            // mouse staffs
            previousMouseState = currentMouseState;
            currentMouseState  = Mouse.GetState();

            UpdateMouse();

            if (!doorOpening)
            {
                if (gameTime.TotalGameTime > SceneStart + FirstLeg && !halfTime)
                {
                    cat.MoveTo(new Point(800 - 170, 0));
                    sounds["goGoGo"].Play();
                    halfTime = true;
                }
                else if (gameTime.TotalGameTime > SceneStart + FirstLeg + SecondLeg)
                {
                    // cout down finish
                    doorOpening = true;
                    gameState   = 1;
                    OpenDoor(gameTime);
                    sounds["shush"].Play();
                    halfTime = false;
                }
            }

            if (!doorOpened && doorOpening)
            {
                if ((gameTime.TotalGameTime - SceneStart) > DoorOpenToComeIn)
                {
                    doorOpened         = true;
                    spaceBar.isVisible = true;
                    door.RenderOrder   = -2;
                    foreach (var item in animals)
                    {
                        item.StopMovement();
                    }
                    cat.SetIMG(0);
                }
            }
            if (doorOpened && doorOpening && Keyboard.GetState().IsKeyDown(Keys.Space) && (gameState == 1))
            {
                gameState      = 2;
                Game1.supriser = Color.White;
                Game1.suprisee = Color.White;


                CheckResult_Scene2();
            }
            if (gameState == 2)
            {
                gameState = 3;

                foreach (var item in animals)
                {
                    if (item.InSpot)
                    {
                        item.DisplayingID = 1;
                    }
                    item.isVisible = true;
                }
                foreach (var item in interactObjs)
                {
                    item.SetIMG(0);
                }
            }
        }