Beispiel #1
0
        public MainMenu()
        {
            quitBinding = new InputBinding();
            quitBinding.Add(Keys.Escape).Add(Buttons.Back).DefineGamePadIndex(0)
                .DefineInputType(InputType.Pressed);

            upBinding = new InputBinding();
            upBinding.Add(Keys.Up, Keys.W).Add(Buttons.DPadUp, Buttons.LeftThumbstickUp)
                .DefineGamePadIndex(0).DefineInputType(InputType.Pressed);

            downBinding = new InputBinding();
            downBinding.Add(Keys.Down, Keys.S).Add(Buttons.DPadDown, Buttons.LeftThumbstickDown)
                .DefineGamePadIndex(0).DefineInputType(InputType.Pressed);

            selectBinding = new InputBinding();
            selectBinding.Add(Keys.Enter, Keys.Space).Add(Buttons.A).DefineGamePadIndex(0)
                .DefineInputType(InputType.Pressed);

            titleText = new Text(TestProject.Assets.GetFont("TitleFont"), "Forward Explosion Run", new Vector2(Engine.Instance.Screen.Width / 2, 5), AlignX.Center, AlignY.Top);
            Add(titleText);

            subtitleText = new Text(TestProject.Assets.GetFont("MenuFont"), "A Networked game by Alex Beauchesne", titleText.Position + new Vector2(0, titleText.Height + 5), AlignX.Center, AlignY.Top);
            Add(subtitleText);

            var instructionsText = new Text(TestProject.Assets.GetFont("MenuFont"), "[Arrow Keys] Choose\n[Space] Select\n[Escape] Quit", new Vector2(Engine.Instance.Screen.Width - 5, 120), AlignX.Right);
            Add(instructionsText);
        }
Beispiel #2
0
        public EndMenu()
        {
            session = Network.ActiveSession;

            quitBinding = new InputBinding();
            quitBinding.Add(Keys.Escape).Add(Buttons.Back).DefineGamePadIndex(0)
                .DefineInputType(InputType.Pressed);

            titleText = new Text(TestProject.Assets.GetFont("TitleFont"), "Game Over", new Vector2(Engine.Instance.Screen.Width / 2, 5), AlignX.Center, AlignY.Top);
            Add(titleText);

            subtitleText = new Text(TestProject.Assets.GetFont("MenuFont"), "Let's look at some results...", titleText.Position + new Vector2(0, titleText.Height + 5), AlignX.Center, AlignY.Top);
            Add(subtitleText);

            errorText = new Text(TestProject.Assets.GetFont("MenuFont"), "", subtitleText.Position + new Vector2(0, subtitleText.Height + 16), AlignX.Center, AlignY.Top);
            Add(errorText);
            errorText.Color = Color.Red;
            errorText.Alpha = 0;

            myGamer = Network.FirstLocalGamer;

            if (Network.ActiveSession.Winners.Count > 0)
                subtitleText.DrawText = String.Format(winString, Network.ActiveSession.Winners[0].GamerTag);
            else
                subtitleText.DrawText = tieString;
        }
Beispiel #3
0
        public CreateMenu()
        {
            quitBinding = new InputBinding();
            quitBinding.Add(Keys.Escape).Add(Buttons.Back).DefineGamePadIndex(0)
                .DefineInputType(InputType.Pressed);

            upBinding = new InputBinding();
            upBinding.Add(Keys.Up, Keys.W).Add(Buttons.DPadUp, Buttons.LeftThumbstickUp)
                .DefineGamePadIndex(0).DefineInputType(InputType.Pressed);

            downBinding = new InputBinding();
            downBinding.Add(Keys.Down, Keys.S).Add(Buttons.DPadDown, Buttons.LeftThumbstickDown)
                .DefineGamePadIndex(0).DefineInputType(InputType.Pressed);

            selectBinding = new InputBinding();
            selectBinding.Add(Keys.Enter, Keys.Space).Add(Buttons.A).DefineGamePadIndex(0)
                .DefineInputType(InputType.Pressed);

            titleText = new Text(TestProject.Assets.GetFont("TitleFont"), "Create New Session", new Vector2(Engine.Instance.Screen.Width / 2, 5), AlignX.Center, AlignY.Top);
            Add(titleText);

            subtitleText = new Text(TestProject.Assets.GetFont("MenuFont"), "Start your own multiplayer session.", titleText.Position + new Vector2(0, titleText.Height + 5), AlignX.Center, AlignY.Top);
            Add(subtitleText);

            errorText = new Text(TestProject.Assets.GetFont("MenuFont"), "", subtitleText.Position + new Vector2(0, subtitleText.Height + 16), AlignX.Center, AlignY.Top);
            Add(errorText);
            errorText.Color = Color.Red;
            errorText.Alpha = 0;

            var instructionsText = new Text(TestProject.Assets.GetFont("MenuFont"), "[Arrow Keys] Choose\n[Space] Select\n[Escape] Back", new Vector2(Engine.Instance.Screen.Width - 5, 120), AlignX.Right);
            Add(instructionsText);

            waitingSprite = new Sprite(TestProject.Assets.GetSprite("WaitSprite"));
            waitingSprite.Position = Engine.Instance.Screen.Center;
            waitingSprite.Y = errorText.Y + errorText.Height + 64;
            waitingSprite.Origin = waitingSprite.Center;
            waitingSprite.AnimationCollection.Add(0, TestProject.Assets.GetSpriteAnimation("WaitSprite", "Normal"));
            waitingSprite.Visible = false;
            Add(waitingSprite);

            UpdateProperties();
        }
Beispiel #4
0
        public LobbyMenu()
        {
            session = Network.ActiveSession;

            quitBinding = new InputBinding();
            quitBinding.Add(Keys.Escape).Add(Buttons.Back).DefineGamePadIndex(0)
                .DefineInputType(InputType.Pressed);

            upBinding = new InputBinding();
            upBinding.Add(Keys.Up, Keys.W).Add(Buttons.DPadUp, Buttons.LeftThumbstickUp)
                .DefineGamePadIndex(0).DefineInputType(InputType.Pressed);

            downBinding = new InputBinding();
            downBinding.Add(Keys.Down, Keys.S).Add(Buttons.DPadDown, Buttons.LeftThumbstickDown)
                .DefineGamePadIndex(0).DefineInputType(InputType.Pressed);

            selectBinding = new InputBinding();
            selectBinding.Add(Keys.Enter, Keys.Space).Add(Buttons.A).DefineGamePadIndex(0)
                .DefineInputType(InputType.Pressed);

            titleText = new Text(TestProject.Assets.GetFont("TitleFont"), "Game Lobby", new Vector2(Engine.Instance.Screen.Width / 2, 5), AlignX.Center, AlignY.Top);
            Add(titleText);

            subtitleText = new Text(TestProject.Assets.GetFont("MenuFont"), "Join with others and play a multiplayer game.", titleText.Position + new Vector2(0, titleText.Height + 5), AlignX.Center, AlignY.Top);
            Add(subtitleText);

            errorText = new Text(TestProject.Assets.GetFont("MenuFont"), "", subtitleText.Position + new Vector2(0, subtitleText.Height + 16), AlignX.Center, AlignY.Top);
            Add(errorText);
            errorText.Color = Color.Red;
            errorText.Alpha = 0;

            var instructionsText = new Text(TestProject.Assets.GetFont("MenuFont"), "[Arrow Keys] Choose\n[Space] Select\n[Escape] Back", new Vector2(Engine.Instance.Screen.Width - 5, 120), AlignX.Right);
            Add(instructionsText);

            speed = session.SessionProperties[0].Value;
            map = session.SessionProperties[1].Value;
        }