Ignore:
Timestamp:
2012-07-05 11:22:43 (9 years ago)
Author:
dezhidki
Message:

Levels are now dissapearing, if not on the screen
Possible to spawn random levels

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 2012/27/DenisZ/TheDungeonGame/TheDungeonGame/TheDungeonGame/TheDungeonGame.cs

    r3570 r3572  
    4646        generator.generateRandomLevel(5, 10); 
    4747        generator.initDungeon(); 
    48       //  generator.buildDungeon(); 
    4948        Room centerRoom = generator.getRoomAt((int)(generator.CenterRoom.X), (int)(generator.CenterRoom.Y)); 
    5049        Camera.Position = centerRoom.Position + new Vector(ROOMWIDTH / 2 + ROOMTHICKNESS / 2, -ROOMHEIGHT / 2 + ROOMTHICKNESS / 4); 
    51         //Camera.ZoomToLevel(); 
    52         //Camera.Zoom(0.5); 
    5350 
    5451        player = new Player(this, Vector.Zero, playerPic); 
     
    10198        newPos = room.Position + new Vector(ROOMWIDTH / 2 + ROOMTHICKNESS / 2, -ROOMHEIGHT / 2 + ROOMTHICKNESS / 4); 
    10299        oldRoom = player.currentRoom; 
    103         room.buildLevel(); 
     100        if (room.isBuilt) room.restoreLevel(); 
     101        else room.buildLevel(); 
    104102        moveCameraTo(newPos - oldPos); 
    105103        player.Position = player.currentRoom.getDoor(dir).Position + RoomDirection.getOffsetFromWorldDir(dir) * 130; 
     
    124122            Camera.Position = newPos; 
    125123            moveCamera = false; 
    126             oldRoom.destroyLevel(); 
     124            oldRoom.hideLevel(); 
    127125        } 
    128126    } 
Note: See TracChangeset for help on using the changeset viewer.