Exemplo n.º 1
0
 private void Transition(GameTime gameTime)
 {
     fade.Update(gameTime, ref animation);
     if (fade.Alpha == 1.0f && fade.Timer.TotalSeconds == 1.0f)
     {
         screenStack.Push(newScreen);
         currentScreen.UnloadContent();
         currentScreen = newScreen;
         currentScreen.LoadContent(content, inputManager);
     }
     else if (fade.Alpha == 0.0f)
     {
         transition    = false;
         fade.IsActive = false;
     }
 }
Exemplo n.º 2
0
        public override void Update(GameTime gameTime)
        {
            inputManager.Update();

            Animation a = animation[imageNumber];

            FAnimation.Update(gameTime, ref a);
            animation[imageNumber] = a;

            if (animation[imageNumber].Alpha == 0.0f)
            {
                imageNumber++;
            }

            if (imageNumber >= animation.Count - 1 || inputManager.KeyPressed(Keys.Z))
            {
                ScreenManager.Instance.AddScreen(new TitleScreen(), inputManager);
            }
        }
Exemplo n.º 3
0
        public void Update(GameTime gameTime, InputManager inputManager)
        {
            if (axis == 1)
            {
                if (inputManager.KeyPressed(Keys.Right, Keys.D))
                {
                    itemNumber++;
                }
                else if (inputManager.KeyPressed(Keys.Left, Keys.A))
                {
                    itemNumber--;
                }
            }
            else
            {
                if (inputManager.KeyPressed(Keys.Down, Keys.S))
                {
                    itemNumber++;
                }
                else if (inputManager.KeyPressed(Keys.Up, Keys.W))
                {
                    itemNumber--;
                }
            }

            if (inputManager.KeyPressed(Keys.Enter, Keys.Space))
            {
                if (linkType[itemNumber] == "Screen")
                {
                    Type newClass = Type.GetType("Hack_Attack." + linkID[itemNumber]);
                    ScreenManager.Instance.AddScreen((GameScreen)Activator.CreateInstance(newClass), inputManager);
                }
            }

            if (itemNumber < 0)
            {
                itemNumber = 0;
            }
            else if (itemNumber > menuItems.Count - 1)
            {
                itemNumber = menuItems.Count - 1;
            }

            for (int i = 0; i < animation.Count; i++)
            {
                for (int j = 0; j < animationTypes.Count; j++)
                {
                    if (itemNumber == i)
                    {
                        animation[i].IsActive = true;
                    }
                    else
                    {
                        animation[i].IsActive = false;
                    }

                    Animation a = animation[i];

                    switch (animationTypes[i])
                    {
                    case "Fade":
                        fAnimation.Update(gameTime, ref a);
                        break;

                    case "SSheet":
                        ssAnimation.Update(gameTime, ref a);
                        break;
                    }
                    animation[i] = a;
                }
            }
        }