Ignore:
Timestamp:
2015-06-29 16:51:35 (4 years ago)
Author:
sieerinn
Message:

Uusi testikenttä. Osa tiilistä voi olla PhysicsObjecteja?.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 2015/27/ohjaajat/TheLegendOfGabriel/TheLegendOfGabriel/TheLegendOfGabriel/TiledTileMap.cs

    r6536 r6538  
    1111{ 
    1212    public delegate void ObjectMethod( 
    13         Vector position, double width, double height, Angle angle, Shape shape, 
    14         Dictionary<string, string> properties); 
     13        Vector position, double width, double height, Angle angle, Shape shape, Dictionary<string, string> properties); 
    1514 
    16     public delegate void TileMethod(Vector position, double width, double height, Image image, string layerName); 
     15    public delegate void TileMethod( 
     16        Vector position, double width, double height, Image image, string layerName, Dictionary<string, string> properties); 
    1717 
    1818    private readonly Dictionary<string, ObjectMethod> objectLegend = new Dictionary<string, ObjectMethod>(); 
     
    8282            double realX = game.Level.Left + (tile.X * tileWidth) + (tileWidth / 2); 
    8383            double realY = game.Level.Top - (tile.Y * tileHeight) - (tileHeight / 2); 
    84             method(new Vector(realX, realY), tileWidth, tileHeight, tileImages[tileIndex], layer.Name); 
     84            Dictionary<string,string> props = level.Tilesets[0].Tiles.Where(t => level.Tilesets[0].FirstGid + t.Id == tile.Gid).Select(t => t.Properties).FirstOrDefault(); 
     85            props = props ?? new Dictionary<string, string>(); 
     86            method(new Vector(realX, realY), tileWidth, tileHeight, tileImages[tileIndex], layer.Name, props); 
    8587        } 
    8688    } 
Note: See TracChangeset for help on using the changeset viewer.