- It demonstrates how to load and use an isometric tmx resource
- Sets up a ControlSystem that moves your character on the map
These lines are key in this demo:
This checks if the isometric tile exists at the point and moves only if it does.
var t *common.Tile
if e.SpaceComponent.Position.X >= 0 {
t = levelData.GetTile(e.SpaceComponent.Center())
} else {
t = levelData.GetTile(engo.Point{
X: e.SpaceComponent.Position.X - float32(levelData.TileWidth),
Y: e.SpaceComponent.Position.Y + float32(levelData.TileHeight),
})
}
if t == nil {
e.SpaceComponent.Position = prev
}