Esempio n. 1
0
        protected override void Initialize()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);
            gameContent = Content;

            Components.Add(new InputHandler(this));

            SheetManager.Initialize(this);

            manager = new GameStateManager(this);
            Components.Add(manager);
            manager.ChangeState(new MainMenuState(this, manager));

            graphics.PreferredBackBufferWidth  = GAME_WIDTH;
            graphics.PreferredBackBufferHeight = GAME_HEIGHT;
            graphics.ApplyChanges();
            IsMouseVisible = true;

            Config.Initialize(this);

            // NoiseGenerator.Initialize(this);

            base.Initialize();
        }
Esempio n. 2
0
        protected override void Initialize()
        {
            Components.Add(new InputHandler(this));

            Config.Initialize(this);

            hud = new HUD(this);
            hud.Initialize();

            SheetManager.Initialize(this);
            canvas = new Canvas(this);

            level = new TileMap(30, 30);
            level.AddTileSet(new TileSet("TileSheets\\dirt.png", 32, 32));

            for (int i = 0; i < 3; i++)
            {
                level.AddLayer(new MapLayer(level));
            }

            level.CurrentLayerIndex = 0;

            canvas.Initialize();

            base.Initialize();
        }