Example #1
0
        public Match(BumbleBee one, BumbleBee two, MeadowField f, int points, int w, bool c_s, bool c_v)
        {
            meadowField = f;

            bumblebeeOne = one;
            bumblebeeTwo = two;

            lights    = new PointLight[2];
            lights[0] = new PointLight(new Vector3(-50, 50, 30), new Vector4(1.0f, 1.0f, 1.0f, 1.0f), new Vector4(1.0f, 1.0f, 1.0f, 1.0f), new Vector4(1.0f, 1.0f, 1.0f, 1.0f), 1000.0f);
            lights[1] = new PointLight(new Vector3(50, -50, 30), new Vector4(1.0f, 1.0f, 1.0f, 1.0f), new Vector4(1.0f, 1.0f, 1.0f, 1.0f), new Vector4(1.0f, 1.0f, 1.0f, 1.0f), 1000.0f);
            Initialize(new Vector2(f.Length, f.Width), points, w, c_s, c_v);
        }
Example #2
0
        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);
            stages.Update(gameTime);
            points.Update(gameTime);
            wind.Update(gameTime);
            enemyVelo.Update(gameTime);
            ballRadius.Update(gameTime);
            back.Update(gameTime);
            play.Update(gameTime);

            if (active < 5)
            {
                options[active].Active = false;
            }
            else
            {
                for (int i = 0; i < 5; i++)
                {
                    options[i].Active = false;
                }
            }

            if (InputManager.Instance.ButtonPressed(Buttons.DPadDown, Buttons.LeftThumbstickDown, Buttons.RightThumbstickDown) || InputManager.Instance.KeyPressed(Keys.Down))
            {
                GameStateManager.Instance.Menu.Play2D("Content//Sound//button.ogg", false);

                if (active == 6)
                {
                    active = 0;
                }
                else
                {
                    active += 1;
                }
            }

            if (InputManager.Instance.ButtonPressed(Buttons.DPadUp, Buttons.LeftThumbstickUp, Buttons.RightThumbstickUp) || InputManager.Instance.KeyPressed(Keys.Up))
            {
                GameStateManager.Instance.Menu.Play2D("Content//Sound//button.ogg", false);

                if (active == 0)
                {
                    active = 6;
                }
                else
                {
                    active -= 1;
                }
            }

            if (active == 5)
            {
                if (InputManager.Instance.ButtonPressed(Buttons.DPadRight, Buttons.LeftThumbstickRight, Buttons.RightThumbstickRight) || InputManager.Instance.KeyPressed(Keys.Right))
                {
                    GameStateManager.Instance.Menu.Play2D("Content//Sound//button.ogg", false);
                    active = 6;
                }
            }

            if (active == 6)
            {
                if (InputManager.Instance.ButtonPressed(Buttons.DPadLeft, Buttons.LeftThumbstickLeft, Buttons.RightThumbstickLeft) || InputManager.Instance.KeyPressed(Keys.Left))
                {
                    GameStateManager.Instance.Menu.Play2D("Content//Sound//button.ogg", false);
                    active = 5;
                }
            }

            if (active < 5)
            {
                options[active].Active = true;
                back.isActive          = false;
                play.isActive          = false;
                back.DeactivateEffect("FadeEffect");
                play.DeactivateEffect("FadeEffect");
                back.Alpha = 1.0f;
                play.Alpha = 1.0f;
            }
            else
            {
                if (active == 5)
                {
                    back.isActive = true;
                    back.ActivateEffect("FadeEffect");
                    play.isActive = false;
                    play.DeactivateEffect("FadeEffect");
                    play.Alpha = 1.0f;
                }
                else
                {
                    play.isActive = true;
                    play.ActivateEffect("FadeEffect");
                    back.isActive = false;
                    back.DeactivateEffect("FadeEffect");
                    back.Alpha = 1.0f;
                }
            }

            if ((back.isActive && (InputManager.Instance.ButtonPressed(Buttons.A) || InputManager.Instance.KeyPressed(Keys.Enter))) || InputManager.Instance.ButtonPressed(Buttons.B) || InputManager.Instance.KeyPressed(Keys.Escape))
            {
                GameStateManager.Instance.ChangeScreens("TitleScreen");
            }

            if (play.isActive && (InputManager.Instance.ButtonPressed(Buttons.A) || InputManager.Instance.KeyPressed(Keys.Enter)))
            {
                if (stages.active == 0)
                {
                    IceField field = new IceField(100, 90, 15, rnd);
                    field.Initialize();

                    GameScreen.Instance.SoundFileName = "Content//Sound//soproSound1.ogg";

                    Pinguin one, two;

                    if (GamePad.GetState(PlayerIndex.Two).IsConnected)
                    {
                        one = new Pinguin(new Vector3(0, -25, 0), 5, 0, 0.5f, 0.8f, field, PlayerIndex.One);
                        two = new Pinguin(new Vector3(0, 25, 0), 5, 0, 0.5f, 0.8f, field, PlayerIndex.Two);
                    }
                    else
                    {
                        one = new Pinguin(new Vector3(0, -25, 0), 5, 0, 0.5f, 0.8f, field);
                        two = new Pinguin(new Vector3(0, 25, 0), 5, 0, 0.5f, 0.8f, field, PlayerIndex.One);
                    }

                    one.Enemy = two;
                    two.Enemy = one;

                    int w = 0;

                    if (wind.Array[wind.active])
                    {
                        w = 1;
                    }

                    GameScreen.Instance.Match = new Match(one, two, field, points.Array[points.active], w, ballRadius.Array[ballRadius.active], enemyVelo.Array[enemyVelo.active]);

                    GameStateManager.Instance.ChangeScreens("GameScreen");
                }

                if (stages.active == 1)
                {
                    MeadowField field = new MeadowField(100, 90, 15, rnd);
                    field.Initialize();

                    GameScreen.Instance.SoundFileName = "Content//Sound//hummel.ogg";

                    BumbleBee one, two;

                    if (GamePad.GetState(PlayerIndex.Two).IsConnected)
                    {
                        one = new BumbleBee(new Vector3(0, -25, 5), 10, 5, 0.5f, 0.8f, field, PlayerIndex.One);
                        two = new BumbleBee(new Vector3(0, 25, 5), 10, 5, 0.5f, 0.8f, field, PlayerIndex.Two);
                    }
                    else
                    {
                        one = new BumbleBee(new Vector3(0, -25, 5), 10, 5, 0.5f, 0.8f, field);
                        two = new BumbleBee(new Vector3(0, 25, 5), 10, 5, 0.5f, 0.8f, field, PlayerIndex.One);
                    }

                    one.Enemy = two;
                    two.Enemy = one;

                    int w = 0;

                    if (wind.Array[wind.active])
                    {
                        w = 1;
                    }

                    GameScreen.Instance.Match = new Match(one, two, field, points.Array[points.active], w, ballRadius.Array[ballRadius.active], enemyVelo.Array[enemyVelo.active]);

                    GameStateManager.Instance.ChangeScreens("GameScreen");
                }

                if (stages.active == 2)
                {
                    WaterField field = new WaterField(100, 90, 15, rnd);
                    field.Initialize();

                    Dolphin one, two;

                    GameScreen.Instance.SoundFileName = "Content//Sound//Delphin.ogg";

                    if (GamePad.GetState(PlayerIndex.Two).IsConnected)
                    {
                        one = new Dolphin(new Vector3(0, -25, 0), 5, 0, 0.5f, 0.8f, field, PlayerIndex.One);
                        two = new Dolphin(new Vector3(0, 25, 0), 5, 0, 0.5f, 0.8f, field, PlayerIndex.Two);
                    }
                    else
                    {
                        one = new Dolphin(new Vector3(0, -25, 0), 5, 0, 0.5f, 0.8f, field);
                        two = new Dolphin(new Vector3(0, 25, 0), 5, 0, 0.5f, 0.8f, field, PlayerIndex.One);
                    }

                    one.Enemy = two;
                    two.Enemy = one;

                    int w = 0;

                    if (wind.Array[wind.active])
                    {
                        w = 1;
                    }

                    GameScreen.Instance.Match = new Match(one, two, field, points.Array[points.active], w, ballRadius.Array[ballRadius.active], enemyVelo.Array[enemyVelo.active]);

                    GameStateManager.Instance.ChangeScreens("GameScreen");
                }
            }
        }