Changeset 3517 for 2012


Ignore:
Timestamp:
2012-07-03 23:13:34 (8 years ago)
Author:
dezhidki
Message:
 
Location:
2012/27/DenisZ/TheDungeonGame
Files:
7 added
3 edited

Legend:

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

    r3515 r3517  
    6060                if (room == 0) 
    6161                { 
    62                     lastRoom = new TestRoom(game, VecMath.mul(CenterRoom, new Vector(TheDungeonGame.ROOMWIDTH, -(TheDungeonGame.ROOMHEIGHT))), TheDungeonGame.roomSize, TheDungeonGame.ROOMTHICKNESS); 
     62                    lastRoom = new TestRoom(game, VecMath.mul(CenterRoom, new Vector(TheDungeonGame.ROOMWIDTH + TheDungeonGame.ROOMTHICKNESS, -TheDungeonGame.ROOMHEIGHT - TheDungeonGame.ROOMTHICKNESS)), TheDungeonGame.roomSize, TheDungeonGame.ROOMTHICKNESS); 
    6363                    placeRoomAt(lastRoom, (int)CenterRoom.X, (int)CenterRoom.Y); 
    6464                    continue; 
     
    100100        { 
    101101            if (getRoomFromDirection(lastRoom, dir) != null) return false; 
    102             currentRoom = new TestRoom(game, VecMath.mul(pos, new Vector(TheDungeonGame.ROOMWIDTH, -TheDungeonGame.ROOMHEIGHT)), TheDungeonGame.roomSize, TheDungeonGame.ROOMTHICKNESS); 
     102            currentRoom = new TestRoom(game, VecMath.mul(pos, new Vector(TheDungeonGame.ROOMWIDTH+TheDungeonGame.ROOMTHICKNESS, -TheDungeonGame.ROOMHEIGHT -TheDungeonGame.ROOMTHICKNESS)), TheDungeonGame.roomSize, TheDungeonGame.ROOMTHICKNESS); 
    103103            return placeRoomAt(currentRoom, (int)pos.X, (int)pos.Y); 
    104104        } 
  • 2012/27/DenisZ/TheDungeonGame/TheDungeonGame/TheDungeonGame/Room.cs

    r3515 r3517  
    9090        { 
    9191            PhysicsObject wallTop = createWall(Position, width + thickness, thickness); 
     92            wallTop.Color = Color.Blue; 
    9293            PhysicsObject wallLeft = createWall(VecMath.sub(Position, new Vector(0, thickness)), thickness, height); 
     94            wallLeft.Color = Color.Red; 
    9395            PhysicsObject wallDown = createWall(VecMath.sub(Position, new Vector(0, height)), width + thickness, thickness); 
    9496            wallDown.Color = Color.Black; 
  • 2012/27/DenisZ/TheDungeonGame/TheDungeonGame/TheDungeonGame/TheDungeonGame.cs

    r3515 r3517  
    2929 
    3030        generator = new LevelGenerator(this, Level.Size, new Vector(20, 20)); 
    31         generator.generateRandomLevel(1, 10); 
     31        generator.generateRandomLevel(10, 15); 
    3232        generator.buildDungeon(); 
    3333 
    3434        player = new Player(this, Vector.Zero); 
    3535        Add(player, 1); 
     36      //  Camera.Follow(player); 
    3637 
    3738        Keyboard.Listen(Key.Escape, ButtonState.Pressed, Exit, "Lopeta peli"); 
     
    4344        generator.destroyDungeon(); 
    4445        generator = new LevelGenerator(this, Level.Size, new Vector(20, 20)); 
    45         generator.generateRandomLevel(1, 10); 
     46        generator.generateRandomLevel(10, 15); 
    4647        generator.buildDungeon(); 
    4748    } 
    4849 
     50    int errorAmount = 0; 
    4951    protected override void Update(Time time) 
    5052    { 
     
    5557        catch (FormatException) // Kaatuu tähän melkein kokoajan kun yrittää luoda tasoa. Mun koodi liian "likainen", tai hidas? 
    5658        { 
     59            if (errorAmount > 50) 
     60            { 
     61                regenerateLevel(); 
     62                errorAmount = 0; 
     63            } 
     64            errorAmount++; 
    5765            return; // Skipataan "virheelisiä" tickea ja huijataan peliä niin kuin pahat merimiehet (dirty pirates, Arr) 
    5866        } 
Note: See TracChangeset for help on using the changeset viewer.