Ejemplo n.º 1
0
        public override void Initialize()
        {
            playerInput = new PlayerInput(PlayerIndex.One);
            this.Game.Components.Add(playerInput);

            playerInput.BindAction("Quit", Keys.Escape);
            playerInput.BindAction("Up", Keys.Up);
            playerInput.BindAction("Down", Keys.Down);
            playerInput.BindAction("Left", Keys.Left);
            playerInput.BindAction("Right", Keys.Right);
            playerInput.BindAction("Swap", Keys.Space);
            playerInput.BindAction("Explode", Keys.Z);
            playerInput.BindAction("ExplodeAll", Keys.X);

            playerInput.BindAction("Reset", Keys.Enter);

            playerInput.BindAction("Up", Buttons.DPadUp);
            playerInput.BindAction("Down", Buttons.DPadDown);
            playerInput.BindAction("Left", Buttons.DPadLeft);
            playerInput.BindAction("Right", Buttons.DPadRight);

            blockGrid = new BlockGrid(48, 48, 12, 10);

            blockGrid.X = 48;
            blockGrid.Y = 64;

            BlockGroup bg = new BlockGroup(3, 3, blockGrid);
            bg.Add(new Block(BlockType.White), 0, 1);
            bg.Add(new Block(BlockType.White), 1, 1);
            bg.Add(new Block(BlockType.White), 2, 1);
            bg.Add(new Block(BlockType.White), 2, 2);

            //blockGrid.Drop(bg, 2);
            blockGrid.Drop(bg, 4);

            InputLimiter = new Limiter[2]{new Limiter(InputLimiterInterval),new Limiter(InputLimiterInterval)};
            dropLimiter = new Limiter(0.15);

            burstEffect = new ParticleEffect_B();
            this.Game.Components.Add(burstEffect);

            explodeEffect = new ParticleEffect_C();
            this.Game.Components.Add(explodeEffect);

            blockGrid.BurstEffect = burstEffect;
            blockGrid.ExplodeEffect = explodeEffect;

            this.Game.Components.Add(blockGrid);

            base.Initialize();

            this.Enabled = true;
        }
Ejemplo n.º 2
0
        public override void Initialize()
        {
            base.Initialize();
            screen3.Initialize();

            this.ID = "base screen";
            screen1.ID = "screen 1";
            screen2.ID = "screen 2";
            screen3.ID = "screen 3";

            double transitionTime = 0.5;

            screen1.TransitionOffTime = TimeSpan.FromSeconds(transitionTime);
            screen1.TransitionOnTime = TimeSpan.FromSeconds(transitionTime);
            screen2.TransitionOffTime = TimeSpan.FromSeconds(transitionTime);
            screen2.TransitionOnTime = TimeSpan.FromSeconds(transitionTime);
            screen3.TransitionOffTime = TimeSpan.FromSeconds(transitionTime);
            screen3.TransitionOnTime = TimeSpan.FromSeconds(transitionTime);

            this.Add(screen1);
            this.Add(screen2);

            playerInput = new PlayerInput(PlayerIndex.One);
            this.Game.Components.Add(playerInput);

            playerInput.BindAction("Pop", Keys.Z );
            playerInput.BindAction("Push", Keys.X);
            playerInput.BindAction("Stay", Keys.C);
            playerInput.BindAction("Load", Keys.A);

            for (int i = 0; i < 1; i++)
            {
                ParticleTest effect = new ParticleTest();
                effect.Initialize();
                this.Add(effect);
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Allows the screen to handle user input. Unlike Update, this method
 /// is only called when the screen is active, and not when some other
 /// screen has taken the focus.
 /// </summary>
 public virtual void HandleInput(PlayerInput input)
 {
 }