Example #1
0
 public void addObjectEntity(BaseMapEntity entity)
 {
     if (entity.location.X >= 0 && entity.location.X < this.width_pix / TILE_WIDTH && entity.location.Y >= 0 && entity.location.Y < this.height_pix / TILE_HEIGHT)
     {
         this.objectList.Add(entity);
         entity.setOccupancy(ref occupancyGrid);
     }
 }
Example #2
0
 public void addMapEntity(BaseMapEntity entity, int xPos, int yPos)
 {
     if (xPos >= 0 && xPos < this.width_pix / TILE_WIDTH && yPos >= 0 && yPos < this.height_pix / TILE_HEIGHT)
     {
         this.tileGrid[xPos, yPos]      = entity;
         this.occupancyGrid[xPos, yPos] = entity.passable ? (byte)1 : (byte)0;
     }
 }