Ejemplo n.º 1
0
        public CreationLevel(float panelWidth, float panelHeight, string levelFile, Graphics g)
        {
            vars = new CreationGlobalVars();

            rand   = new Random();
            this.g = g;

            Bitmap lvlImg = ( Bitmap )Bitmap.FromFile(levelFile);

            cameraWidth      = panelWidth;
            cameraHeight     = panelHeight;
            this.levelWidth  = lvlImg.Width * GlobalVars.LEVEL_READER_TILE_WIDTH;
            this.levelHeight = lvlImg.Height * GlobalVars.LEVEL_READER_TILE_HEIGHT;

            if (!sysManagerInit)
            {
                sysManager = new CreationSystemManager(this);
            }

            sysManagerInit = true;

            LevelImageReader lvlImgReader = new LevelImageReader(this, lvlImg);

            lvlImgReader.readImage(this);

            //levelBeginState = new Dictionary<int, Entity>(entities); //Copy the beginning game state

            prevTicks = DateTime.Now.Ticks;

            levelFullyLoaded = true;
        }
Ejemplo n.º 2
0
        public CreationLevel(float levelWidth, float levelHeight, float panelWidth, float panelHeight, Graphics g)
        {
            vars = new CreationGlobalVars();

            rand   = new Random();
            this.g = g;

            this.cameraWidth  = panelWidth;
            this.cameraHeight = panelHeight;
            this.levelWidth   = levelWidth;
            this.levelHeight  = levelHeight;

            if (!sysManagerInit)
            {
                sysManager = new CreationSystemManager(this);
            }

            sysManagerInit = true;

            prevTicks = DateTime.Now.Ticks;

            levelFullyLoaded = true;
        }