Ejemplo n.º 1
0
 public Camera(Map map, List <Entity> entities, ANewWorld form, ArrayMapCacher arrayMapCacher, GraphicsDevice graphicsDevice, SpriteBatch spriteBatch, Player player, GraphicsDeviceManager graphicsManager, TileTextureMap tileTextureMap, FrameCounter frameCounter, SpriteFont spriteFont)
 {
     this.map             = map;
     this.entities        = entities;
     this.form            = form;
     this.arrayMapCacher  = arrayMapCacher;
     this.graphicsDevice  = graphicsDevice;
     this.spriteBatch     = spriteBatch;
     this.player          = player;
     this.graphicsManager = graphicsManager;
     this.tileTextureMap  = tileTextureMap;
     this.frameCounter    = frameCounter;
     this.spriteFont      = spriteFont;
 }
Ejemplo n.º 2
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);

            spriteFont    = Content.Load <SpriteFont>("Font");
            playerSprite  = Content.Load <Texture2D>("Ghost");
            evilBoxSprite = Content.Load <Texture2D>("EvilBox");
            Texture2D dirtSprite = Content.Load <Texture2D>("Dirt");

            Camera.tileSprite   = dirtSprite;
            Camera.playerSprite = playerSprite;

            Dictionary <int, Texture2D> typesAndBlockTextures = new Dictionary <int, Texture2D>();

            typesAndBlockTextures.Add(0, Content.Load <Texture2D>("NullBlock"));
            typesAndBlockTextures.Add(1, Content.Load <Texture2D>("Air"));
            typesAndBlockTextures.Add(2, dirtSprite);
            typesAndBlockTextures.Add(3, Content.Load <Texture2D>("Grass"));

            tileTextureMap = new TileTextureMap(typesAndBlockTextures);
        }