Ejemplo n.º 1
0
        public void Tick(TimeSpan elapsedGameTime)
        {
            if (DateTime.Now - State.StartHop > State.NextHop)
            {
                setNextHop();
                RandomPenguinHop.Restart();
            }

            if (!PenguinLogoAnimation.Completed)
            {
                PenguinLogoAnimation.Tick(elapsedGameTime);
            }
            if (!ShuffleLogoAnimation.Completed)
            {
                ShuffleLogoAnimation.Tick(elapsedGameTime);
            }
            if (!RandomPenguinHop.Completed)
            {
                RandomPenguinHop.Tick(elapsedGameTime);
            }
            if (!PlayButtonAnimation.Completed)
            {
                PlayButtonAnimation.Tick(elapsedGameTime);
            }
            if (!InitialPenguinHop.Completed)
            {
                InitialPenguinHop.Tick(elapsedGameTime);
            }

            switch (State.AboutState)
            {
            case AboutState.Closed:
                break;

            case AboutState.Opened:
                break;

            case AboutState.Opening:
                State.NextHop = new TimeSpan(1, 0, 0);
                AboutOpenAnimation.Tick(elapsedGameTime);
                AboutOpenDialogAnimation.Tick(elapsedGameTime);
                break;

            case AboutState.Closing:
                State.NextHop = new TimeSpan(1, 0, 0);
                AboutCloseAnimation.Tick(elapsedGameTime);
                AboutCloseDialogAnimation.Tick(elapsedGameTime);
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
            if (State.StartClicked)
            {
                StartGameAnimation.Tick(elapsedGameTime);
            }
            GameService.CloudSubLayout.TickLayoutView(elapsedGameTime);
            State.SoundSubLayout.TickLayoutView(elapsedGameTime);
        }
Ejemplo n.º 2
0
        public override void Render(TimeSpan elapsedGameTime)
        {
            mainLayer.Begin();


            GameService.CloudSubLayout.Render(mainLayer);
            State.SoundSubLayout.Render(mainLayer);

            mainLayer.Save();

            IImage logoImage    = Assets.Images.Layouts.PenguinLogo;
            IImage shuffleImage = Assets.Images.Layouts.ShuffleLogo;

            if (PenguinLogoAnimation.Completed)
            {
                mainLayer.DrawImage(logoImage, Positions.PenguinLogoLocation, true);
            }
            else
            {
                PenguinLogoAnimation.Render(mainLayer);
            }

            if (ShuffleLogoAnimation.Completed)
            {
                mainLayer.DrawImage(shuffleImage, Positions.ShuffleLogoLocation, true);
            }
            else
            {
                ShuffleLogoAnimation.Render(mainLayer);
            }


            if (!PlayButtonAnimation.Completed)
            {
                PlayButtonAnimation.Render(mainLayer);
            }

            else
            {
                if (State.ShowingTutorial > 0)
                {
                    mainLayer.DrawImage(Assets.Images.Layouts.Tutorials.Tutorial[State.ShowingTutorial], Positions.TutorialPosition, true);
                }
                else
                {
                    if (!State.StartClicked)
                    {
                        mainLayer.DrawImage(Assets.Images.Layouts.PlayButton, Positions.StartLocation, true);
                    }
                }
            }

            if (State.ShowingTutorial > 0)
            {
                mainLayer.DrawImage(Assets.Images.Layouts.Tutorials.Tutorial[State.ShowingTutorial], Positions.TutorialPosition, true);
            }
            else
            {
                mainLayer.DrawImage(Assets.Images.Layouts.AboutButton, Positions.TutorialButtonPosition, true);

                if (State.StartClicked)
                {
                    StartGameAnimation.Render(mainLayer);
                }
                else
                {
                    renderAbout();
                }
            }

            mainLayer.Restore();


            //            TouchManager.Render(mainLayer);
            mainLayer.End();
        }