Exemplo n.º 1
0
        /// <summary>
        /// Crea un editor de mapa
        /// </summary>
        /// <param name="cols">Columnas totales del mapa</param>
        /// <param name="rows">Renglones totales del mapa</param>
        /// <param name="texturas">Diccionario de texturas</param>
        /// <param name="callback">Callback para manejar eventos</param>
        public MapManager(int cols, int rows, Dictionary <string, Texture2D> texturas, MapManagerCallbackEvent callback = null)
        {
            this.texturas = texturas;
            setSize(cols, rows);
            dot = texturas["dot"];

            if (callback != null)
            {
                this._callback = callback;
            }
        }
Exemplo n.º 2
0
        protected override void Initialize()
        {
            base.Initialize();

            graphicsDevice = this.GraphicsDevice;

            // inicializa la camara con los graficos de la pantalla actual
            camera = new Camera(GraphicsDevice.Viewport);

            // Enlaza el manejador de eventos a una funcion local
            callback = new MapManagerCallbackEvent(hasNotice);

            // carga las texturas necesarias para el editor y demás
            loadTextures();

            // crea un enemigo [TEST]
            enemy = new Enemy(enemyTexture, enemyLifeBar, new Vector2(100, 100));

            // HUD
            Hud = new HUD(listHUD);
        }