Esempio n. 1
0
        public void SelectNext()
        {
            Game.Instance.AudioPlayer.Play(Menu.ChangeSound, 0.5f);

            SelectedItem.Deactivate();

            selected++;
            if (selected == MenuItems.Length)
            {
                selected = 0;
            }

            SelectedItem.Activate();
            selectedSize.Start(Game.Instance.GlobalClock.ContinuousMilliseconds);
        }
Esempio n. 2
0
 public ItemizedMenuScreen(Menu menu) :
     base(menu, new Vector2(640, 360))
 {
     //this.width = width;
     selectedSize   = new SineFloat(0.7f, 0.9f, 10.0f);
     unselectedSize = new SineFloat(0.48f, 0.52f, 3.0f);
     selectedSize.Start(Game.Instance.GlobalClock.ContinuousMilliseconds);
     unselectedSize.Start(Game.Instance.GlobalClock.ContinuousMilliseconds);
 }
Esempio n. 3
0
        public PlayerMenu(Menu menu, LevelMenu levelMenu)
            : base(menu, new Vector2(640, 160))
        {
            this.levelMenu = levelMenu;

            playerBackgroundInactive = Game.Instance.ContentManager.Load <Texture2D>("Sprites/Menu/robot_selection_background_inactive");

            DrawPrevious = false;

            // initialize walking player hack
            Effect clonedEffect = Game.Instance.ContentManager.Load <Effect>("Effects/Basic/Basic").Clone();

            playerModel = Game.Instance.ContentManager.Load <MagmaModel>("Models/Player/robot_grp").XnaModel;
            playerMesh  = playerModel.Meshes[0];
            foreach (ModelMeshPart meshPart in playerMesh.MeshParts)
            {
                Effect oldEffect = meshPart.Effect;
                meshPart.Effect = clonedEffect;
                oldEffect.Dispose();
            }
            animator       = new ModelAnimator(playerModel);
            walkController = new AnimationController(Game.Instance, animator.Animations["walk"]);
            Game.Instance.Components.RemoveAt(Game.Instance.Components.Count - 1);
            foreach (BonePose p in animator.BonePoses)
            {
                p.CurrentController      = walkController;
                p.CurrentBlendController = null;
                p.BlendFactor            = 0.0f;
            }

            playerPreview = new RenderTarget2D[MaxPlayers];
            for (int i = 0; i < MaxPlayers; ++i)
            {
                playerPreview[i] = new RenderTarget2D(Game.Instance.GraphicsDevice, 445, 445, false,
                                                      Game.Instance.GraphicsDevice.PresentationParameters.BackBufferFormat, DepthFormat.Depth24Stencil8);
            }

            playerTexture   = Game.Instance.ContentManager.Load <Texture2D>("Textures/Player/Robot_texture10");
            specularTexture = Game.Instance.ContentManager.Load <Texture2D>("Textures/Player/robot_spec");

            playerBoxSize = new SineFloat(0.96f, 1.0f, 8.0f);
            playerBoxSize.Start(0.001f);
        }
Esempio n. 4
0
 private Menu()
 {
     StaticStringStrength = new SineFloat(0.7f, 1.0f, 2.5f);
     StaticStringStrength.Start(0.001);
 }