Exemplo n.º 1
0
        protected override void Initialize()
        {
            graphics.PreferredBackBufferHeight = height;
            graphics.PreferredBackBufferWidth = width;
            graphics.IsFullScreen = false;
            graphics.ApplyChanges();

            /*========================================*/
            MenuItemComponent menuItems = new MenuItemComponent(this, new Vector2(30, 290), Color.Black, Color.Yellow, 56);

            menuItems.AddItem("START");
            menuItems.AddItem("INSTRUCTIONS");
            menuItems.AddItem("AUTHORS");
            menuItems.AddItem("\nEND");

            MenuComponent menu = new MenuComponent(this, menuItems);
            LevelComponent level = new LevelComponent(this);
            HUD hud = new HUD(this);

            mainMenu = new GameWindow(this, menu, menuItems);
            gameLevel = new GameWindow(this, level, hud);

            /*========================================*/

            foreach (GameComponent komponenta in Components)
            {
                SwitchComponent(komponenta, false);
            }

            // switch window to main menu
            SwitchWindow(mainMenu);

            base.Initialize();
        }
Exemplo n.º 2
0
        protected override void Initialize()
        {
            graphics.PreferredBackBufferHeight = height;
            graphics.PreferredBackBufferWidth  = width;
            graphics.IsFullScreen = false;
            graphics.ApplyChanges();



            /*========================================*/
            MenuItemComponent menuItems = new MenuItemComponent(this, new Vector2(30, 290), Color.Black, Color.Yellow, 56);

            menuItems.AddItem("START");
            menuItems.AddItem("INSTRUCTIONS");
            menuItems.AddItem("AUTHORS");
            menuItems.AddItem("\nEND");

            MenuComponent  menu  = new MenuComponent(this, menuItems);
            LevelComponent level = new LevelComponent(this);
            HUD            hud   = new HUD(this);

            mainMenu  = new GameWindow(this, menu, menuItems);
            gameLevel = new GameWindow(this, level, hud);

            /*========================================*/

            foreach (GameComponent komponenta in Components)
            {
                SwitchComponent(komponenta, false);
            }

            // switch window to main menu
            SwitchWindow(mainMenu);

            base.Initialize();
        }