Changeset 3547


Ignore:
Timestamp:
2012-07-04 14:58:39 (11 years ago)
Author:
dezhidki
Message:

Added new Entity things

Location:
2012/27/DenisZ/TheDungeonGame/TheDungeonGame/TheDungeonGame
Files:
3 edited

Legend:

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

    r3539 r3547  
    55using Jypeli; 
    66using MathHelper; 
     7using Entity; 
    78 
    89namespace Rooms 
     
    2425        public Vector PosOnGrid { get; set; } 
    2526        public PhysicsObject wall; 
     27        public int EntityAmount { get; set; } 
    2628 
    2729        public Room(TheDungeonGame game, Vector pos, Vector size, double thickness) 
     
    9698        } 
    9799 
     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 
    98109 
    99110        // En vitsinyt käyttää enempää aikaa tämän parantamiseksi. Helppo ja toimiva 
    100111        public void addDoors() 
    101112        { 
    102          //   if (directions.Length > 4) throw new ArgumentException("Argument's length must be 4!"); 
    103  
    104113            for (int i = 0; i < 4; i++) 
    105114            { 
     
    142151                    doors[i] = door; 
    143152                } 
    144                     
     153 
    145154            } 
    146155        } 
  • 2012/27/DenisZ/TheDungeonGame/TheDungeonGame/TheDungeonGame/TheDungeonGame.cs

    r3539 r3547  
    3636        Room centerRoom = generator.getRoomAt((int)(generator.CenterRoom.X), (int)(generator.CenterRoom.Y)); 
    3737        Camera.Position = centerRoom.Position + new Vector(ROOMWIDTH / 2 + ROOMTHICKNESS / 2, -ROOMHEIGHT / 2 + ROOMTHICKNESS / 4); 
    38       //  Camera.Zoom(0.5); 
    3938 
    4039        player = new Player(this, Vector.Zero); 
     
    5756    { 
    5857        cameraPosMission = pos; 
    59         cameraVelocity = pos * 1.5 ; 
     58        cameraVelocity = pos * 1.5; 
    6059        moveCamera = true; 
    6160    } 
     
    6564        Camera.Velocity = cameraVelocity; 
    6665        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)); 
    6867        if (Math.Abs((int)remainingLenght.X) < 20 && Math.Abs((int)remainingLenght.Y) < 20) 
    6968        { 
     
    7473            moveCamera = false; 
    7574        } 
    76          
     75 
    7776    } 
    7877 
  • 2012/27/DenisZ/TheDungeonGame/TheDungeonGame/TheDungeonGame/TheDungeonGame.csproj

    r3515 r3547  
    113113  </ItemGroup> 
    114114  <ItemGroup> 
     115    <Compile Include="Entity.cs" /> 
     116    <Compile Include="EntityTemplates.cs" /> 
    115117    <Compile Include="LevelGenerator.cs" /> 
    116118    <Compile Include="Room.cs" /> 
     
    118120    <Compile Include="MathHelper.cs" /> 
    119121    <Compile Include="Ohjelma.cs" /> 
    120     <Compile Include="TestRoom.cs" /> 
     122    <Compile Include="RoomTemplates.cs" /> 
    121123    <Compile Include="TheDungeonGame.cs" /> 
    122124    <Compile Include="Properties\AssemblyInfo.cs" /> 
Note: See TracChangeset for help on using the changeset viewer.