예제 #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();
        }
예제 #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();
        }
예제 #3
0
 public MenuComponent(Game game, MenuItemComponent menuItems)
     : base(game)
 {
     this.game = game;
     this.menuItems = menuItems;
 }
예제 #4
0
 public MenuComponent(Game game, MenuItemComponent menuItems)
     : base(game)
 {
     this.game      = game;
     this.menuItems = menuItems;
 }