Esempio n. 1
0
        public void Update()
        {
            if (MENU_STATE == "menu")
            {
                newGame.Update(MouseLocation);
                leaderBoard.Update(MouseLocation);
                options.Update(MouseLocation);
                exit.Update(MouseLocation);
            }

            else if (MENU_STATE == "settings")
            {
                settings.Update();
                settings.MouseLocation = MouseLocation;
                back.Update(MouseLocation);
            }
            else
            {
                back.Update(MouseLocation);
            }


            if (newGame.CanPerformAction())
            {
                Game.state = GameState.active;
            }

            if (leaderBoard.CanPerformAction())
            {
                Rl.LoadRanking();
                MENU_STATE = "lboard";
            }

            if (options.CanPerformAction())
            {
                MENU_STATE = "settings";
            }

            if (exit.CanPerformAction())
            {
                ns.Close();
            }

            if (back.CanPerformAction())
            {
                MENU_STATE = "menu";
            }
        }
Esempio n. 2
0
        public RunSummary(NativeWindow _ns, Player _player)
        {
            GAME_OVER  = new Text((-6.7f, 3.5f), "GAME OVER", TextType.ui, 1.5f);
            SCOREBOARD = new Text((-7.5f, 3.5f), "SCOREBOARD", TextType.ui, 1.5f);
            TIME_SCORE = new Text((-7.2f, 2.5f), "TIME    SCORE", TextType.ui, 0.70f);
            PLAYTIME   = new Text((-6.7f, 2.5f), "Run Time: ", TextType.ui, 0.75f);
            EXP        = new Text((-6.7f, 1.5F), "EXP: ", TextType.ui, 0.75f);
            Exp        = new Text((1f, 1.5F), " ", TextType.ui, 0.75f);
            PlayTime   = new Text((1f, 2.5f), Time.GetTime(), TextType.ui, 0.75f);
            background = new Icon((-9f, -6f), Sprite.Single(ResourceManager.GetTexture("UI_back_empty"), (18f, 12f)));
            RankCanvas = new Icon((-10.5f, 0.9f), Sprite.Single(ResourceManager.GetTexture("itemFrame"), (14f, 1.8f)));
            rank       = new Text((-6f, 2.5f), " ", TextType.ui, 0.5f);

            SummaryRankSwitchButton = new Button((-1.5F, -4F), (3, 11), "this run", TextType.ui);
            ExitGameButton          = new Button((-4.5F, -5.5F), (3, 11), "Exit Game", TextType.ui);
            NewGameButton           = new Button((1.5F, -5.5F), (3, 11), "New Game", TextType.ui);

            t             = Time.GetInstance();
            ns            = _ns;
            player        = _player;
            rankingLoader = new RankingLoader();
            rankingLoader.LoadRanking();
        }