Ejemplo n.º 1
0
 public Camera(Map map, List <Entity> entities, Form1 form, ArrayMapCacher arrayMapCacher)
 {
     this.map            = map;
     this.entities       = entities;
     this.form           = form;
     this.arrayMapCacher = arrayMapCacher;
 }
Ejemplo n.º 2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            loadMap();
            mapCacher = new ArrayMapCacher(map.GetLength(0), map.GetLength(1), map);
            camera    = new Camera(map, entities, this, mapCacher);

            WindowState    = FormWindowState.Maximized;
            DoubleBuffered = true;

            Bitmap playerSprite;

            //playerSprite = new Bitmap(Bitmap.FromFile(@""));
            playerSprite = createBox(100, 100, Color.Black);
            player       = new Player(playerSprite, 60, 200);
            entities.Add(player);

            keyManager = new KeysManager(player);

            gameLoop          = new Timer();
            gameLoop.Interval = 10;
            gameLoop.Tick    += GameLoop_Tick;
            gameLoop.Start();



            keyManager.registerKeybind(Keys.F, new SaveKeybind(mapLoader));
            keyManager.registerKeybind(Keys.R, new NewMapKeybind(mapLoader, this));
        }
Ejemplo n.º 3
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;
 }