Example #1
0
        public NewGameMenu()
        {
            menuLabels.Add(new MenuLabel(name, fontName));
            menuItems.Add(new MenuItem(ok, fontName, false));
            menuItems.Add(new MenuItem(back, fontName, true));

            menuLabels[0].Position    = ShortcutProvider.ScreenCenter - ShortcutProvider.GetFontCenter(fontName, menuItems[0].ItemName) + new Vector2(-200, 0);
            menuItems[0].ItemPosition = ShortcutProvider.ScreenCenter - ShortcutProvider.GetFontCenter(fontName, menuItems[1].ItemName) + 2 * itemOffset;
            menuItems[1].ItemPosition = ShortcutProvider.ScreenCenter - ShortcutProvider.GetFontCenter(fontName, menuItems[1].ItemName) + 3 * itemOffset;

            EventInput.EventInput.Initialize(VariableProvider.Game.Window);
            EventInput.EventInput.CharEntered += new EventInput.CharEnteredHandler(CharacterEntered);
            TextBuffer = "";

            confirmDialog = new ConfirmOverlay(this);
        }
Example #2
0
    public void NewGame()
    {
        sound.PlayConfirm();

        if (File.Exists(savePath))
        {
            GameObject     confirmOverlay = Instantiate(confirmOverlayPrefab);
            ConfirmOverlay co             = confirmOverlay.GetComponent <ConfirmOverlay>();
            co.SetBaseMenu(this);
            co.SetContents(DeleteAndStart, co.Close, "Start new game?", "This will overwrite your old save!", "Clear Save", "Cancel");
        }
        else
        {
            StartGame();
        }
    }
Example #3
0
        public HomeState()
        {
            gameObjects.AddChild(new SpriteGameObject("Sprites/Backgrounds/spr_play", Depth.Backgroud));

            getBallButton = new Button("Sprites/Buttons/spr_btn_get_ball", Depth.Button);
            getBallButton.SetOriginToRightTop();
            getBallButton.LocalPosition = new Vector2(680, 170);

            changeBallButton = new Button("Sprites/Buttons/spr_btn_change_ball", Depth.Button);
            changeBallButton.SetOriginToLeftBottom();
            changeBallButton.LocalPosition = new Vector2(100, 940);

            playButton = new Button("Sprites/Buttons/spr_btn_play", Depth.Button);
            playButton.SetOriginToRightBottom();
            playButton.LocalPosition = new Vector2(600, 940);

            logo = new SpriteGameObject("Sprites/UI/spr_logo_name", Depth.Button);
            logo.SetOriginToCenter();
            logo.LocalPosition = new Vector2(350, 550);
            gameObjects.AddChild(logo);

            moneyText = new TextGameObject("Fonts/PlayMoney", Depth.Button, Color.White, TextGameObject.HorizontalAlignment.Left, TextGameObject.VerticalAlignment.Center);
            gameObjects.AddChild(moneyText);
            moneyText.LocalPosition = new Vector2(120, 1132);


            gameObjects.AddChild(getBallButton);
            gameObjects.AddChild(changeBallButton);
            gameObjects.AddChild(playButton);

            getBallOverlay = new GetBallOverlay();
            gameObjects.AddChild(getBallOverlay);

            confirmOverlay = new ConfirmOverlay(getBallOverlay);
            gameObjects.AddChild(confirmOverlay);

            warningOverlay = new WarningOverlay();
            gameObjects.AddChild(warningOverlay);

            Reset();
        }