Exemplo n.º 1
0
        public override void Update(GameTime gameTime, InputManager inputMan, WorldManager worldMan)
        {
            //title.pos.Y = 0.4f + ((float)Math.Sin(gameTime.TotalGameTime.TotalMilliseconds / 300.0) * 0.01f);

            //if (inputMan.StartPressed()) exitmenu = true;
            if (inputMan.DownPressed()) cursorpos += 1;
            if (inputMan.UpPressed()) cursorpos -= 1;
            if (cursorpos > 2) cursorpos = 0;
            if (cursorpos < 0) cursorpos = 2;

            cursor.pos.Y = 0.55f + ((float)cursorpos) * 0.05f;
            cursor.pos.X = 0.35f + ((float)Math.Sin(gameTime.TotalGameTime.TotalMilliseconds / 100.0) * 0.005f);

            el_newgame.scale = 0.5f;
            el_options.scale = 0.5f;
            el_quit.scale = 0.5f;

            if (cursorpos == 0)
            {
                el_newgame.scale = 0.6f;
                if (inputMan.EnterPressed())
                {
                    switching = true;
                    nextPage = startGamePage;
                }
            }
            else if (cursorpos == 1)
            {
                el_options.scale = 0.6f;
                if (inputMan.EnterPressed())
                {
                    //switching = true;
                }
            }
            else if (cursorpos == 2)
            {
                el_quit.scale = 0.6f;
                if (inputMan.EnterPressed())
                {
                    exit = true;
                }
            }
        }
Exemplo n.º 2
0
        public void Update(GameTime gameTime, InputManager inputMan, WorldManager worldMan)
        {
            if (currentMenu.SwitchingPages())
            {
                currentMenu = currentMenu.GetNextPage();
            }

            currentMenu.Update(gameTime, inputMan, worldMan);

            if (currentMenu.SaveGame())
            {
                save = true;
            }

            if (currentMenu.ExitMenu())
            {
                active = false;
            }

            if (currentMenu.ExitGame())
            {
                quit = true;
            }
        }