Пример #1
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);
            this.IsMouseVisible = true;
            graphics.PreferredBackBufferHeight = 768;
            graphics.PreferredBackBufferWidth = 1024;
            graphics.ApplyChanges();
            player = new Player();
            camera = new Camera(GraphicsDevice.Viewport);
            tiles = new TileMap(Content.Load<Texture2D>("tileSheet"), camera, Content.Load<Texture2D>("BlockSelector"));
            selector = Content.Load<Texture2D>("BlockSelector");
            tiles.toLevel();
            LEPos = new Vector2(300, 300);

            // TODO: use this.Content to load your game content here
        }
Пример #2
0
 public TileMap(Texture2D tiles, Camera camera, Texture2D selector)
 {
     tileSheet = tiles;
     this.camera = camera;
     this.selector = selector;
 }