Changeset 3547
- Timestamp:
- 2012-07-04 14:58:39 (11 years ago)
- Location:
- 2012/27/DenisZ/TheDungeonGame/TheDungeonGame/TheDungeonGame
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
2012/27/DenisZ/TheDungeonGame/TheDungeonGame/TheDungeonGame/Room.cs
r3539 r3547 5 5 using Jypeli; 6 6 using MathHelper; 7 using Entity; 7 8 8 9 namespace Rooms … … 24 25 public Vector PosOnGrid { get; set; } 25 26 public PhysicsObject wall; 27 public int EntityAmount { get; set; } 26 28 27 29 public Room(TheDungeonGame game, Vector pos, Vector size, double thickness) … … 96 98 } 97 99 100 public void addEntityAt(EntityBase ent, int bx, int by) 101 { 102 if (bx >= bWidth || bx < 0 || by >= bHeight || by < 0 || insideObjects[bx, by] != null) throw new Exception("Can't put block to " + bx + " , " + by); 103 EntityAmount++; 104 ent.Left = insidePos.X + (bx * blockWidth); 105 ent.Top = insidePos.Y * (by * blockHeight); 106 insideObjects[bx, by] = ent; 107 } 108 98 109 99 110 // En vitsinyt käyttää enempää aikaa tämän parantamiseksi. Helppo ja toimiva 100 111 public void addDoors() 101 112 { 102 // if (directions.Length > 4) throw new ArgumentException("Argument's length must be 4!");103 104 113 for (int i = 0; i < 4; i++) 105 114 { … … 142 151 doors[i] = door; 143 152 } 144 153 145 154 } 146 155 } -
2012/27/DenisZ/TheDungeonGame/TheDungeonGame/TheDungeonGame/TheDungeonGame.cs
r3539 r3547 36 36 Room centerRoom = generator.getRoomAt((int)(generator.CenterRoom.X), (int)(generator.CenterRoom.Y)); 37 37 Camera.Position = centerRoom.Position + new Vector(ROOMWIDTH / 2 + ROOMTHICKNESS / 2, -ROOMHEIGHT / 2 + ROOMTHICKNESS / 4); 38 // Camera.Zoom(0.5);39 38 40 39 player = new Player(this, Vector.Zero); … … 57 56 { 58 57 cameraPosMission = pos; 59 cameraVelocity = pos * 1.5 58 cameraVelocity = pos * 1.5; 60 59 moveCamera = true; 61 60 } … … 65 64 Camera.Velocity = cameraVelocity; 66 65 Vector remainingLenght = Camera.Position - newPos; 67 Console.WriteLine(Math.Abs(remainingLenght.X)+", " + Math.Abs(remainingLenght.Y));66 // Console.WriteLine(Math.Abs(remainingLenght.X)+", " + Math.Abs(remainingLenght.Y)); 68 67 if (Math.Abs((int)remainingLenght.X) < 20 && Math.Abs((int)remainingLenght.Y) < 20) 69 68 { … … 74 73 moveCamera = false; 75 74 } 76 75 77 76 } 78 77 -
2012/27/DenisZ/TheDungeonGame/TheDungeonGame/TheDungeonGame/TheDungeonGame.csproj
r3515 r3547 113 113 </ItemGroup> 114 114 <ItemGroup> 115 <Compile Include="Entity.cs" /> 116 <Compile Include="EntityTemplates.cs" /> 115 117 <Compile Include="LevelGenerator.cs" /> 116 118 <Compile Include="Room.cs" /> … … 118 120 <Compile Include="MathHelper.cs" /> 119 121 <Compile Include="Ohjelma.cs" /> 120 <Compile Include=" TestRoom.cs" />122 <Compile Include="RoomTemplates.cs" /> 121 123 <Compile Include="TheDungeonGame.cs" /> 122 124 <Compile Include="Properties\AssemblyInfo.cs" />
Note: See TracChangeset
for help on using the changeset viewer.