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:
2024-03-28 19:41:20 +01:00
parent f6d5385d35
commit dcf31e46ed
12 changed files with 541 additions and 60 deletions

View File

@@ -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)