static void Main()
    {
        bool fullScreen = false;

        SdlHardware.Init(1024, 768, 24, fullScreen);

        WelcomeScreen w = new WelcomeScreen();

        do
        {
            w.Run();
            if (w.GetChosenOption() == WelcomeScreen.OPTION_PLAY)
            {
                Game g = new Game();
                g.Run();
            }
            else if (w.GetChosenOption() == WelcomeScreen.OPTION_HELP)
            {
                HelpScreen help = new HelpScreen();
                help.Run();
            }
            else if (w.GetChosenOption() == WelcomeScreen.OPTION_CREDITS)
            {
                CreditsScreen credits = new CreditsScreen();
                credits.Run();
            }
        }while (w.GetChosenOption() != WelcomeScreen.OPTION_QUIT);
    }
Example #2
0
 public override void _EnterTree()
 {
     // This needs to be done early here to make sure the help screen loads the right text
     helpScreen          = GetNode <HelpScreen>(HelpScreenPath);
     helpScreen.Category = HelpCategory;
     base._EnterTree();
 }
Example #3
0
    void CheckUserInput()
    {
        if (SdlHardware.KeyPressed(SdlHardware.KEY_Q))
        {
            finished = true;
        }

        if (SdlHardware.KeyPressed(SdlHardware.KEY_H))
        {
            HelpScreen help = new HelpScreen();
            help.Run();
        }

        if (canThrowDice)
        {
            if (SdlHardware.KeyPressed(SdlHardware.KEY_D))
            {
                // Wait if key D is pressed
                while (SdlHardware.KeyPressed(SdlHardware.KEY_D))
                {
                }
                ChangeTurn();
            }
        }
    }
Example #4
0
 public void btn_nav_Click(object sender, RoutedEventArgs e)
 {
     if (btn_specials.IsFocused)
     {
         Switcher.Switch(new Page_Specials());
         switch_btn_bg(btn_specials, "specials");
         //btn_specials.Background = new ImageBrush(new BitmapImage(new Uri("../../Resources/Images/btn_specials_down_bg.png", UriKind.Relative)));
     }
     else if (btn_drinks.IsFocused)
     {
         Switcher.Switch(new Page_Drinks());
         switch_btn_bg(btn_drinks, "drinks");
     }
     else if (btn_food.IsFocused)
     {
         Switcher.Switch(new Page_Food());
         switch_btn_bg(btn_food, "food");
     }
     else if (btn_help.IsFocused)
     {
         GrayedOutWindow gw = new GrayedOutWindow();
         HelpScreen      hs = new HelpScreen();
         gw.Show();
         hs.ShowDialog();
         gw.Close();
     }
 }
Example #5
0
    public static void Main(string[] args)
    {
        bool fullScreen = false;

        SdlHardware.Init(960, 750, 24, fullScreen);

        WelcomeScreen w = new WelcomeScreen();

        do
        {
            w.Run();
            if (w.GetChosenOption() == 1)
            {
                Game g = new Game();
                g.Run();
            }
            else if (w.GetChosenOption() == 2)
            {
                HelpScreen help = new HelpScreen();
                help.Run();
            }
            else if (w.GetChosenOption() == 3)
            {
                CreditsScreen credits = new CreditsScreen();
                credits.Run();
            }
        } while (w.GetChosenOption() != 4);
    }
Example #6
0
    public static void Main()
    {
        bool fullScreen = false;

        SdlHardware.Init(1024, 720, 24, fullScreen);

        WelcomeScreen w = new WelcomeScreen();

        do
        {
            w.Run();
            if (w.GetChosenOption() == 1)
            {
                Game g = new Game();
                g.Run();
            }
            else if (w.GetChosenOption() == 2)
            {
                CreditsScreen credits = new CreditsScreen();
                credits.Run();
            }
            else if (w.GetChosenOption() == 3)
            {
                HelpScreen help = new HelpScreen();
                help.Run();
            }
            else if (w.GetChosenOption() == 4)
            {
                ScoreBoard sb = new ScoreBoard();
                sb.Run();
            }
        } while (w.GetChosenOption() != 5);
    }
Example #7
0
        private void DrawHelp(HelpScreen help)
        {
            var skull = help.Menu.Tics / 8 % 2 == 0 ? "M_SKULL1" : "M_SKULL2";

            if (DoomApplication.Instance.IWad == "doom2" ||
                DoomApplication.Instance.IWad == "freedoom2" ||
                DoomApplication.Instance.IWad == "plutonia" ||
                DoomApplication.Instance.IWad == "tnt")
            {
                this.DrawMenuPatch("HELP", 0, 0);
                this.DrawMenuPatch(skull, 298, 160);
            }
            else
            {
                if (help.Page == 0)
                {
                    this.DrawMenuPatch("HELP1", 0, 0);
                    this.DrawMenuPatch(skull, 298, 170);
                }
                else
                {
                    this.DrawMenuPatch("HELP2", 0, 0);
                    this.DrawMenuPatch(skull, 248, 180);
                }
            }
        }
Example #8
0
        private void DrawHelp(HelpScreen help)
        {
            this.DrawMenuPatch("HELP", 0, 0);

            var skull = help.Menu.Tics / 8 % 2 == 0 ? "M_SKULL1" : "M_SKULL2";

            this.DrawMenuPatch(skull, 298, 160);
        }
Example #9
0
        public void HelpScreenCloseButton()
        {
            //Arrange
            HelpScreen target = new HelpScreen();

            //Act
            target.btnClose.PerformClick();

            //Assert
            //Assert.IsTrue(target.IsDisposed);
        }
Example #10
0
 void Start()
 {
     pt = PaintableTexture.Instance;
     // Todo: replace below with singletons to avoid need for linking in the editor
     sb               = stickHolder.GetComponent <StickBehavior>();
     helpScreen       = helpScreenParent.GetComponent <HelpScreen>();
     h2c              = h2view.GetComponent <h2viewcontrol>();
     stickInitQ       = stickHolder.transform.localRotation;
     cameraInitQ      = camera.transform.localRotation;
     surfaceInitQ     = surface.transform.localRotation;
     Cursor.lockState = CursorLockMode.Locked;
     Cursor.visible   = false;
 }
Example #11
0
        public void HelpScreenElements()
        {
            //Arrange
            HelpScreen target = new HelpScreen();

            //Act

            //Assert
            Assert.IsTrue(target.HelpText.Equals("For complete rules visit:"));
            Assert.IsTrue(target.WikiUrl.Equals("http://en.wikipedia.org/wiki/Yahtzee"));
            Assert.IsTrue(target.btnClose.Text.Equals("Close"));
            Assert.IsTrue(target.pictureBox1.BackgroundImage != null);
        }
Example #12
0
    public void Start()
    {
        Hardware             hardware = new Hardware(1024, 720, 24, false);
        WelcomeScreen        welcome  = new WelcomeScreen(hardware);
        LanguageSelectScreen languaje = new LanguageSelectScreen(hardware);

        welcome.Run();
        languaje.Run();
        MenuScreen menu = new MenuScreen(hardware, languaje.languaje);

        do
        {
            GameScreen    game    = new GameScreen(hardware);
            HelpScreen    help    = new HelpScreen(hardware, languaje.languaje);
            StatsScreen   stats   = new StatsScreen(hardware, languaje.languaje);
            CreditsScreen credits = new CreditsScreen(hardware, languaje.languaje);

            Player   p = Player.GetPlayer();
            DateTime begin;
            DateTime timeEnd;

            hardware.ClearScreen();
            menu.exit   = false;
            menu.option = -1;
            Console.WriteLine("Menu");
            menu.Run();

            switch (menu.option)
            {
            case 0:
                help.Run();
                begin = DateTime.Now;
                game.Run();
                timeEnd = DateTime.Now;
                TimeSpan       time = timeEnd - begin;
                GameOverScreen end  = new GameOverScreen(hardware, time, languaje.languaje);
                end.Run();
                break;

            case 1:
                stats.Run();
                break;

            case 2:
                credits.Run();
                break;
            }
            Thread.Sleep(50);
        } while (menu.option != 3 ||
                 hardware.IsKeyPressed(Hardware.KEY_ESC));
    }
Example #13
0
        /// <summary>
        /// Gestiona cualquier pulsación para <see cref="HelpScreen"/>
        /// </summary>
        /// <param name="helpScreen">Escena de ayuda que llama al método</param>
        /// <param name="gameTime">Valor de tiempo actual</param>
        public static void Help(HelpScreen helpScreen, GameTime gameTime)
        {
            MouseState mState = Mouse.GetState();

            if (mState.LeftButton == ButtonState.Pressed && mOldState.LeftButton == ButtonState.Released)
            {
                if (helpScreen.backRect.Contains(mState.Position))   //back
                {
                    GameMain.currentScreen = new MenuScreen(helpScreen.Content, helpScreen.GraphicsDevice);
                }
            }

            mOldState = mState;
        }
Example #14
0
 protected override void LoadContent()
 {
     spriteBatch = new SpriteBatch(GraphicsDevice);
     Services.AddService(typeof(SpriteBatch), spriteBatch);
     normalFont = Content.Load<SpriteFont>("normal");
     background = Content.Load<Texture2D>("gryphon");
     startScreen = new StartScreen(this, normalFont, background);
     Components.Add(startScreen);
     background = Content.Load<Texture2D>("fire-dragon");
     helpScreen = new HelpScreen(this, background);
     Components.Add(helpScreen);
     startScreen.Show();
     helpScreen.Hide();
     activeScreen = startScreen;
 }
    public ScreensManager()
    {
        graphics = new GraphicsDeviceManager(this);
        Content.RootDirectory = "Content";

        game       = new GameMain(1280, 720);
        welcomeScr = new WelcomeScreen(this);
        loadingScr = new LoadingScreen(this);
        creditsScr = new CreditsScreen(this);
        configScr  = new ConfigScreen(this);
        helpScr    = new HelpScreen(this);
        endScr     = new EndScreen(this);

        currentMode = MODE.LOADING;
    }
Example #16
0
    public override void _Ready()
    {
        compoundBars = GetTree().GetNodesInGroup("CompoundBar");
        panelsTween  = GetNode <Tween>("LeftPanels/PanelsTween");

        mouseHoverPanel = GetNode <PanelContainer>(MouseHoverPanelPath);
        pauseButton     = GetNode <TextureButton>(PauseButtonPath);
        resumeButton    = GetNode <TextureButton>(ResumeButtonPath);
        leftPanels      = GetNode <VBoxContainer>(LeftPanelsPath);
        agentsPanel     = GetNode <Control>(AgentsPanelPath);

        environmentPanel             = GetNode <NinePatchRect>(EnvironmentPanelPath);
        environmentPanelBarContainer = GetNode <GridContainer>(EnvironmentPanelBarContainerPath);
        oxygenBar     = GetNode <ProgressBar>(OxygenBarPath);
        co2Bar        = GetNode <ProgressBar>(Co2BarPath);
        nitrogenBar   = GetNode <ProgressBar>(NitrogenBarPath);
        temperature   = GetNode <ProgressBar>(TemperaturePath);
        sunlightLabel = GetNode <ProgressBar>(SunlightPath);
        pressure      = GetNode <ProgressBar>(PressurePath);

        compoundsPanel             = GetNode <NinePatchRect>(CompoundsPanelPath);
        compoundsPanelBarContainer = GetNode <GridContainer>(CompoundsPanelBarContainerPath);
        glucoseBar         = GetNode <ProgressBar>(GlucoseBarPath);
        ammoniaBar         = GetNode <ProgressBar>(AmmoniaBarPath);
        phosphateBar       = GetNode <ProgressBar>(PhosphateBarPath);
        hydrogenSulfideBar = GetNode <ProgressBar>(HydrogenSulfideBarPath);
        ironBar            = GetNode <ProgressBar>(IronBarPath);

        oxytoxyBar               = GetNode <ProgressBar>(OxytoxyBarPath);
        atpBar                   = GetNode <TextureProgress>(AtpBarPath);
        healthBar                = GetNode <TextureProgress>(HealthBarPath);
        ammoniaReproductionBar   = GetNode <TextureProgress>(AmmoniaReproductionBarPath);
        phosphateReproductionBar = GetNode <TextureProgress>(PhosphateReproductionBarPath);

        atpLabel        = GetNode <Label>(AtpLabelPath);
        hpLabel         = GetNode <Label>(HpLabelPath);
        menu            = GetNode <Control>(MenuPath);
        animationPlayer = GetNode <AnimationPlayer>(AnimationPlayerPath);
        hoveredItems    = GetNode <VBoxContainer>(HoveredItemsContainerPath);
        populationLabel = GetNode <Label>(PopulationLabelPath);
        patchLabel      = GetNode <Label>(PatchLabelPath);
        editorButton    = GetNode <TextureButton>(EditorButtonPath);
        helpScreen      = GetNode <HelpScreen>(HelpScreenPath);

        OnEnterStageTransition();
    }
Example #17
0
    public void Run()
    {
        Console.WriteLine("Welcome");
        Console.WriteLine("1-Game");
        Console.WriteLine("2-Help");
        Console.WriteLine("3-Demo");
        Console.WriteLine("ESC-Quit");
        ConsoleKeyInfo key = Console.ReadKey();

        switch (key.Key)
        {
        case ConsoleKey.D1: Game g = new Game(); g.Run(); break;

        case ConsoleKey.D2: HelpScreen h = new HelpScreen(); h.Run(); break;

        case ConsoleKey.D3: DemoScreen d = new DemoScreen(); d.Run(); break;
        }
    }
Example #18
0
    static void Main()
    {
        Inicialize();

        SdlHardware.Init(1200, 768, 24, FullScreen);
        WelcomeScreen w = new WelcomeScreen();

        os = new OptionsScreen();
        LoadGamesScreen lg = new LoadGamesScreen();
        HelpScreen      hs = new HelpScreen();

        int option;

        do
        {
            option = w.Run();
            switch (option)
            {
            case 0: break;

            case 1: g = new Game();  g.Run();
                break;

            case 2:
                if (lg.Run() == 0)
                {
                    g.Run();
                }
                break;

            case 3: os.Run();
                SaveOptions();
                SdlHardware.Init(1200, 768, 24, FullScreen);
                break;

            case 4: hs.Run();
                break;
            }
        } while (option != 5);
    }
Example #19
0
    void CheckUserInput()
    {
        if (SdlHardware.KeyPressed(SdlHardware.KEY_SPC))
        {
            if (SdlHardware.KeyPressed(SdlHardware.KEY_RIGHT))
            {
                player.JumpRight(room);
            }
            else if (SdlHardware.KeyPressed(SdlHardware.KEY_LEFT))
            {
                player.JumpLeft(room);
            }
            else
            {
                player.Jump(room);
            }
        }


        if (SdlHardware.KeyPressed(SdlHardware.KEY_RIGHT))
        {
            player.MoveRight(room);
        }
        if (SdlHardware.KeyPressed(SdlHardware.KEY_LEFT))
        {
            player.MoveLeft(room);
        }

        if (SdlHardware.KeyPressed(SdlHardware.KEY_H))
        {
            HelpScreen help = new HelpScreen();
            help.Run();
        }

        if (SdlHardware.KeyPressed(SdlHardware.KEY_ESC))
        {
            finished = true;
        }
    }
Example #20
0
        private void DrawHelp(HelpScreen help)
        {
            var skull = help.Menu.Tics / 8 % 2 == 0 ? "M_SKULL1" : "M_SKULL2";

            if (help.Menu.Options.GameMode == GameMode.Commercial)
            {
                DrawMenuPatch("HELP", 0, 0);
                DrawMenuPatch(skull, 298, 160);
            }
            else
            {
                if (help.Page == 0)
                {
                    DrawMenuPatch("HELP1", 0, 0);
                    DrawMenuPatch(skull, 298, 170);
                }
                else
                {
                    DrawMenuPatch("HELP2", 0, 0);
                    DrawMenuPatch(skull, 248, 180);
                }
            }
        }
        static void Main(string[] args)
        {
            bool fullScreen = false;

            Hardware.Init(1024, 768, 24, fullScreen);
            bool finished = false;

            while (!finished)
            {
                WelcomeScreen welcome = new WelcomeScreen();
                welcome.Run();
                CreditsScreen credits = new CreditsScreen();
                HelpScreen    help    = new HelpScreen();
                if (welcome.GetOptionChosen() == WelcomeScreen.options.Play)
                {
                    Game myGame = new Game();
                    myGame.Run();

                    GameOverScreen gameEnd = new GameOverScreen();
                    gameEnd.Run();
                }

                if (welcome.GetOptionChosen() == WelcomeScreen.options.Quit)
                {
                    finished = true;
                }
                if (welcome.GetOptionChosen() == WelcomeScreen.options.Credits)
                {
                    credits.Run();
                }
                if (welcome.GetOptionChosen() == WelcomeScreen.options.Help)
                {
                    Game myGame = new Game();
                    help.Run();
                }
            }
        }
Example #22
0
    public static void Main(string[] args)
    {
        SdlHardware.Init(1280, 720, 24, false);

        LoadingScreen ls = new LoadingScreen();

        ls.Run();

        WelcomeScreen welcome = new WelcomeScreen();

        do
        {
            welcome.Run();
            if (welcome.GetChosenOption() == WelcomeScreen.OPTION_PLAY)
            {
                Game g = new Game();
                g.Run();
                EndScreen end = new EndScreen();
                end.Run();
            }
            else if (welcome.GetChosenOption() == WelcomeScreen.OPTION_HELP)
            {
                HelpScreen help = new HelpScreen();
                help.Run();
            }
            else if (welcome.GetChosenOption() == WelcomeScreen.OPTION_CREDITS)
            {
                CreditsScreen credits = new CreditsScreen();
                credits.Run();
            }
            else if (welcome.GetChosenOption() == WelcomeScreen.OPTION_CONFIG)
            {
                ConfigScreen config = new ConfigScreen();
                config.Run();
            }
        }while (welcome.GetChosenOption() != WelcomeScreen.OPTION_QUIT);
    }
Example #23
0
    public void Run()
    {
        // TO DO: Create a real Menu, instead of showing all the screens

        IntroScreen intro = new IntroScreen();

        intro.Run();

        MenuScreen menu = new MenuScreen();

        do
        {
            menu.Run();
            switch (menu.GetChosenOption())
            {
            case MenuScreen.MenuOption.Game:
                Game g = new Game(menu.RetroLook);
                g.Run();
                break;

            case MenuScreen.MenuOption.Help:
                HelpScreen help = new HelpScreen(menu.RetroLook);
                help.Run();
                break;

            case MenuScreen.MenuOption.Credits:
                CreditsScreen credits = new CreditsScreen(menu.RetroLook);
                credits.Run();
                break;

            case MenuScreen.MenuOption.Scores:
                HiScoresScreen hiScores = new HiScoresScreen(menu.RetroLook);
                hiScores.Run();
                break;
            }
        } while (menu.GetChosenOption() != MenuScreen.MenuOption.Exit);
    }
Example #24
0
    void CheckUserInput()
    {
        if (SdlHardware.KeyPressed(SdlHardware.KEY_RIGHT))
        {
            if (room.CanMoveTo(player.GetX() + player.GetSpeedX(),
                               player.GetY(),
                               player.GetX() + player.GetWidth() + player.GetSpeedX(),
                               player.GetY() + player.GetHeight()))
            {
                player.MoveRight();
            }
        }
        if (SdlHardware.KeyPressed(SdlHardware.KEY_LEFT))
        {
            if (room.CanMoveTo(player.GetX() - player.GetSpeedX(),
                               player.GetY(),
                               player.GetX() + player.GetWidth() - player.GetSpeedX(),
                               player.GetY() + player.GetHeight()))
            {
                player.MoveLeft();
            }
        }
        if (SdlHardware.KeyPressed(SdlHardware.KEY_UP))
        {
            if (room.CanMoveTo(player.GetX(),
                               player.GetY() - player.GetSpeedY(),
                               player.GetX() + player.GetWidth(),
                               player.GetY() + player.GetHeight() - player.GetSpeedY()))
            {
                player.MoveUp();
            }
        }
        if (SdlHardware.KeyPressed(SdlHardware.KEY_DOWN))
        {
            if (room.CanMoveTo(player.GetX(),
                               player.GetY() + player.GetSpeedY(),
                               player.GetX() + player.GetWidth(),
                               player.GetY() + player.GetHeight() + player.GetSpeedY()))
            {
                player.MoveDown();
            }
        }

        if (SdlHardware.KeyPressed(SdlHardware.KEY_SPC))
        {
            bombs.Add(new Bomb());
            bombs[bombs.Count - 1].MoveTo(player.GetX(), player.GetY());
            bombs[bombs.Count - 1].Show();
            bombs[bombs.Count - 1].Enable();
        }

        if (SdlHardware.KeyPressed(SdlHardware.KEY_H))
        {
            HelpScreen help = new HelpScreen();
            help.Run();
        }

        if (SdlHardware.KeyPressed(SdlHardware.KEY_ESC))
        {
            finished = true;
        }
    }
Example #25
0
 void Awake()
 {
     instance = this;
     gameObject.SetActive(false);
 }
Example #26
0
    public override void _Ready()
    {
        organelleSelectionElements = GetTree().GetNodesInGroup("OrganelleSelectionElement");
        membraneSelectionElements  = GetTree().GetNodesInGroup("MembraneSelectionElement");
        itemTooltipElements        = GetTree().GetNodesInGroup("ItemTooltip");

        loadingScreen = GetNode <LoadingScreen>("LoadingScreen");

        menu                          = GetNode <Control>(MenuPath);
        sizeLabel                     = GetNode <Label>(SizeLabelPath);
        speedLabel                    = GetNode <Label>(SpeedLabelPath);
        generationLabel               = GetNode <Label>(GenerationLabelPath);
        mutationPointsLabel           = GetNode <Label>(MutationPointsLabelPath);
        mutationPointsBar             = GetNode <TextureProgress>(MutationPointsBarPath);
        speciesNameEdit               = GetNode <LineEdit>(SpeciesNameEditPath);
        membraneColorPicker           = GetNode <ColorPicker>(MembraneColorPickerPath);
        newCellButton                 = GetNode <TextureButton>(NewCellButtonPath);
        undoButton                    = GetNode <TextureButton>(UndoButtonPath);
        redoButton                    = GetNode <TextureButton>(RedoButtonPath);
        symmetryButton                = GetNode <TextureButton>(SymmetryButtonPath);
        finishButton                  = GetNode <Button>(FinishButtonPath);
        atpBalanceLabel               = GetNode <Label>(ATPBalanceLabelPath);
        atpProductionBar              = GetNode <ProgressBar>(ATPProductionBarPath);
        atpConsumptionBar             = GetNode <ProgressBar>(ATPConsumptionBarPath);
        atpProductionLabel            = GetNode <Label>(ATPProductionLabelPath);
        atpConsumptionLabel           = GetNode <Label>(ATPConsumptionLabelPath);
        glucoseReductionLabel         = GetNode <Label>(GlucoseReductionLabelPath);
        autoEvoLabel                  = GetNode <Label>(AutoEvoLabelPath);
        externalEffectsLabel          = GetNode <Label>(ExternalEffectsLabelPath);
        mapDrawer                     = GetNode <PatchMapDrawer>(MapDrawerPath);
        patchNothingSelected          = GetNode <Control>(PatchNothingSelectedPath);
        patchDetails                  = GetNode <Control>(PatchDetailsPath);
        patchName                     = GetNode <Label>(PatchNamePath);
        patchPlayerHere               = GetNode <Control>(PatchPlayerHerePath);
        patchBiome                    = GetNode <Label>(PatchBiomePath);
        patchTemperature              = GetNode <Label>(PatchTemperaturePath);
        patchPressure                 = GetNode <Label>(PatchPressurePath);
        patchLight                    = GetNode <Label>(PatchLightPath);
        patchOxygen                   = GetNode <Label>(PatchOxygenPath);
        patchNitrogen                 = GetNode <Label>(PatchNitrogenPath);
        patchCO2                      = GetNode <Label>(PatchCO2Path);
        patchHydrogenSulfide          = GetNode <Label>(PatchHydrogenSulfidePath);
        patchAmmonia                  = GetNode <Label>(PatchAmmoniaPath);
        patchGlucose                  = GetNode <Label>(PatchGlucosePath);
        patchPhosphate                = GetNode <Label>(PatchPhosphatePath);
        patchIron                     = GetNode <Label>(PatchIronPath);
        speciesList                   = GetNode <VBoxContainer>(SpeciesListPath);
        physicalConditionsBox         = GetNode <Control>(PhysicalConditionsBoxPath);
        atmosphericConditionsBox      = GetNode <Control>(AtmosphericConditionsBoxPath);
        compoundsBox                  = GetNode <Control>(CompoundsBoxPath);
        moveToPatchButton             = GetNode <Button>(MoveToPatchButtonPath);
        physicalConditionsButton      = GetNode <Control>(PhysicalConditionsButtonPath);
        atmosphericConditionsButton   = GetNode <Control>(AtmosphericConditionsButtonPath);
        compoundsButton               = GetNode <Control>(CompoundsBoxButtonPath);
        speciesListButton             = GetNode <Control>(SpeciesListButtonPath);
        symmetryIcon                  = GetNode <TextureRect>(SymmetryIconPath);
        patchTemperatureSituation     = GetNode <TextureRect>(PatchTemperatureSituationPath);
        patchLightSituation           = GetNode <TextureRect>(PatchLightSituationPath);
        patchHydrogenSulfideSituation = GetNode <TextureRect>(PatchHydrogenSulfideSituationPath);
        patchGlucoseSituation         = GetNode <TextureRect>(PatchGlucoseSituationPath);
        patchIronSituation            = GetNode <TextureRect>(PatchIronSituationPath);
        patchAmmoniaSituation         = GetNode <TextureRect>(PatchAmmoniaSituationPath);
        patchPhosphateSituation       = GetNode <TextureRect>(PatchPhosphateSituationPath);
        rigiditySlider                = GetNode <Slider>(RigiditySliderPath);
        helpScreen                    = GetNode <HelpScreen>(HelpScreenPath);

        mapDrawer.OnSelectedPatchChanged = (drawer) => { UpdateShownPatchDetails(); };

        // Fade out for that smooth satisfying transition
        TransitionManager.Instance.AddScreenFade(Fade.FadeType.FadeOut, 0.5f);
        TransitionManager.Instance.StartTransitions(null, string.Empty);
    }
Example #27
0
        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.White);

            // TODO: Add your drawing code here

            spriteBatch.Begin();

            switch (Globals.Gamestate)
            {
            case Globals.LOGO:
            {
                // Draws the logo
                spriteBatch.Draw(logoImg, new Rectangle(300, 360, 600, 80), Color.White);
                break;
            }

            case Globals.MENU:
            {
                Menu.Draw(spriteBatch, gameTime);
                break;
            }

            case Globals.TRANSITION:
            {
                TransitionScreen.Draw(spriteBatch);
                break;
            }

            case Globals.GAMEPLAY:
            {
                // Draws the assets of the appropriate game
                switch (Globals.Minigame)
                {
                case Globals.LUCKY_DAY:
                {
                    luckyDay.Draw(spriteBatch, gameTime);
                    break;
                }

                case Globals.COLOR_GUESSER:
                {
                    colorGuesser.Draw(spriteBatch);
                    break;
                }

                case Globals.RAINDROPS:
                {
                    raindrops.Draw(spriteBatch, gameTime);
                    break;
                }

                case Globals.JUGGLER:
                {
                    juggler.Draw(spriteBatch, gameTime);
                    break;
                }

                case Globals.TERMINAL_VELOCITY:
                {
                    terminalVelocity.Draw(spriteBatch, gameTime);
                    break;
                }

                case Globals.BACKWARDS:
                {
                    backwards.Draw(spriteBatch);
                    break;
                }

                case Globals.TYPEWRITER:
                {
                    typewriter.Draw(spriteBatch);
                    break;
                }

                case Globals.FLOOR_IS_LAVA:
                {
                    floorIsLava.Draw(spriteBatch, gameTime);
                    break;
                }

                case Globals.MILKSHAKER:
                {
                    milkshaker.Draw(spriteBatch);
                    break;
                }

                case Globals.CIRCLE_CLICKER:
                {
                    circleClicker.Draw(spriteBatch);
                    break;
                }
                }

                // Draws the hud elements
                Hud.Draw(spriteBatch);
                break;
            }

            case Globals.RESULTS:
            {
                Results.Draw(spriteBatch);
                break;
            }

            case Globals.LEADERBOARD:
            {
                Leaderboard.Draw(spriteBatch);
                break;
            }
            }

            // Draws the help screen if it is open
            if (Globals.HelpScreenOpen && !Globals.Fade.Active)
            {
                HelpScreen.Draw(spriteBatch);
            }

            // Draws the pause screen if it is active
            if (paused)
            {
                spriteBatch.Draw(blankRecImg, Globals.GetRec(), Color.Black * pausedOpacity);
                spriteBatch.DrawString(bigFont, "PAUSED", Globals.CentreText(Globals.GetRec(), "PAUSED", bigFont), Color.White);

                spriteBatch.Draw(menuBtn.Img, menuBtn.Rec, Color.White);
            }

            // Draws the fade if it is active
            if (Globals.Fade.Active)
            {
                Globals.Fade.Draw(spriteBatch);
            }

            spriteBatch.End();

            base.Draw(gameTime);
        }
Example #28
0
    private void helpButton_Click(object sender, System.EventArgs e)
    {
        HelpScreen helpScreen = new HelpScreen();

        helpScreen.ShowDialog();
    }
 private void helpButton_Click(object sender, System.EventArgs e)
 {
     HelpScreen helpScreen = new HelpScreen();
         helpScreen.ShowDialog();
 }
Example #30
0
 public void ShowHelp(HelpScreen newHelpScreen)
 {
     helpScreen = newHelpScreen;
     Show();
 }
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);
            Services.AddService(typeof(SpriteBatch), spriteBatch);

            var scorpionDictionary = DictionaryLoader.GetDictionary(GameSettings.firstName, Content);
            var subZeroDictionary  = DictionaryLoader.GetDictionary(GameSettings.secondName, Content);
            var firstHealth        = new HealthBar(GameSettings.HealthBar, Content.Load <Texture2D>("DamageBar"));
            var secondHealth       = new HealthBar(new Vector2(width - GameSettings.HealthBar.X, GameSettings.HealthBar.Y), Content.Load <Texture2D>("DamageBar"));
            var firstMoves         = new PlayerControls();

            firstMoves.GetFirstPlayerKeyboard();
            var secondMoves = new PlayerControls();

            secondMoves.GetSecondPlayerKeyboard();

            //first player
            var firstSprite = new SpriteAnimation(GameSettings.SpriteWidth, GameSettings.SpriteHeigth, false)
            {
                SpriteTexture = scorpionDictionary,
                Moves         = firstMoves,
                Position      = new Vector2(GameSettings.FirstPosition.X - 100, GameSettings.FirstPosition.Y)
            };

            //second player
            var secondSprite = new SpriteAnimation(GameSettings.SpriteWidth, GameSettings.SpriteHeigth, true)
            {
                SpriteTexture = subZeroDictionary,
                Moves         = secondMoves,
                Position      = new Vector2(GameSettings.FirstPosition.X + 100, GameSettings.FirstPosition.Y)
            };

            //game screen
            var arenaRect    = new Rectangle(0, 0, graphics.GraphicsDevice.Adapter.CurrentDisplayMode.Width, graphics.GraphicsDevice.Adapter.CurrentDisplayMode.Height);
            var arenaTexture = Content.Load <Texture2D>("Arenas//TheDeadPoolArena");

            gameScreen = new GameScreen(this, Content.Load <SpriteFont>("Pristina"), Content.Load <SpriteFont>("Courier New"), width, arenaTexture, arenaRect)
            {
                FirstSprite    = firstSprite,
                FirstHealthBar = firstHealth,

                SecondSprite    = secondSprite,
                SecondHealthBar = secondHealth,
            };

            //menu screen
            var font         = Content.Load <SpriteFont>("Narkisim");
            var gameNameItem = new MenuItem
            {
                MenuFont         = font,
                MenuItemPosition = new Vector2(width / 2, 100),
                MenuItemName     = "Mortal Kombat",
                MenuItemOrigin   = font.MeasureString("Mortal Kombat") / 2
            };

            font = Content.Load <SpriteFont>("Viner Hand ITC");
            var startItem = new MenuItem
            {
                MenuFont         = font,
                MenuItemPosition = new Vector2(width / 2, 300),
                MenuItemName     = "New game",
                MenuItemOrigin   = font.MeasureString("New game") / 2
            };
            var helpItem = new MenuItem
            {
                MenuFont         = font,
                MenuItemPosition = new Vector2(width / 2, 400),
                MenuItemName     = "Help",
                MenuItemOrigin   = font.MeasureString("Help") / 2
            };
            var exitItem = new MenuItem
            {
                MenuFont         = font,
                MenuItemPosition = new Vector2(width / 2, 500),
                MenuItemName     = "Exit",
                MenuItemOrigin   = font.MeasureString("Exit") / 2
            };
            var menuItems = new MenuItem[]
            {
                startItem,
                helpItem,
                exitItem,
                gameNameItem
            };
            var texture = Content.Load <Texture2D>("BackgroundMenu");
            var rect    = new Rectangle(0, 0, graphics.GraphicsDevice.Adapter.CurrentDisplayMode.Width,
                                        graphics.GraphicsDevice.Adapter.CurrentDisplayMode.Height);

            menuScreen = new MenuScreen(this, menuItems, texture, rect);

            //help screen
            helpScreen = new HelpScreen(this, texture, rect, Content.Load <SpriteFont>("Courier new"), Content.Load <SpriteFont>("Viner Hand ITC"), firstMoves, secondMoves);

            //game pause screen
            font = Content.Load <SpriteFont>("Viner Hand ITC");
            var resumeItem = new MenuItem
            {
                MenuFont         = font,
                MenuItemPosition = new Vector2(width / 2, 300),
                MenuItemName     = "Resume",
                MenuItemOrigin   = font.MeasureString("Resume") / 2
            };

            exitItem = new MenuItem
            {
                MenuFont         = font,
                MenuItemPosition = new Vector2(width / 2, 400),
                MenuItemName     = "Exit",
                MenuItemOrigin   = font.MeasureString("Exit") / 2
            };
            menuItems = new MenuItem[]
            {
                resumeItem,
                exitItem
            };
            gamePauseScreen = new GamePauseScreen(this, menuItems);

            //game restart screen
            font = Content.Load <SpriteFont>("Viner Hand ITC");
            var restartItem = new MenuItem
            {
                MenuFont         = font,
                MenuItemPosition = new Vector2(width / 2, 300),
                MenuItemName     = "New game",
                MenuItemOrigin   = font.MeasureString("New game") / 2
            };

            exitItem = new MenuItem
            {
                MenuFont         = font,
                MenuItemPosition = new Vector2(width / 2, 400),
                MenuItemName     = "Exit",
                MenuItemOrigin   = font.MeasureString("Exit") / 2
            };
            menuItems = new MenuItem[]
            {
                restartItem,
                exitItem
            };
            gameRestartScreen = new GameRestartScreen(this, menuItems);

            Components.Add(menuScreen);
            Components.Add(gameScreen);
            Components.Add(helpScreen);
            Components.Add(gamePauseScreen);
            Components.Add(gameRestartScreen);
            menuScreen.Show();
        }
Example #32
0
        private void Help(object sender, RoutedEventArgs e)
        {
            HelpScreen popup = new HelpScreen();

            popup.ShowDialog();
        }