fixes+changes:
- fixed windows build, using path, instead of path/filepath - added switch + door, implemented relation (pair_system missing yet) - fixed ldtk map loading, now using correct entitymap.png tileset
This commit is contained in:
@@ -164,11 +164,20 @@ func LevelToSlice(game *Game, level *ldtkgo.Level, tilesize int) (Map, Map) {
|
||||
|
||||
case ldtkgo.LayerTypeEntity:
|
||||
// load mobile tiles (they call them entities) using static map map.png.
|
||||
tileset := assets.Assets["primarymap"]
|
||||
tileset := assets.Assets["entitymap"]
|
||||
|
||||
for _, entity := range layer.Entities {
|
||||
if entity.TileRect != nil {
|
||||
tile := assets.Tiles[entity.Identifier]
|
||||
tile.Id = entity.IID
|
||||
|
||||
ref := entity.PropertyByIdentifier("Entity_ref")
|
||||
if ref != nil {
|
||||
if ref.Value != nil {
|
||||
refid := ref.Value.(map[string]interface{})
|
||||
tile.Ref = refid["entityIid"].(string)
|
||||
}
|
||||
}
|
||||
|
||||
slog.Debug("LOAD TILE", "tile", entity.TileRect)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user