There must be a good explanation for this that I failed to realize:
I am trying to move my character around the map, with following setup:
local map = dusk.buildMap('maps/large.json') local player = map.layer['Main'].object['Player'] map.setCameraFocus(player)
my event handler is simple, check for key event and increment/decrement player.x / player.y
this works, until player.x or player.y exceeds the device screen size.
say for iphone 6, where screen width is 375, when player.x move beyond 375, it returns nil instead:
attempt to perform arithmetic on field 'x' (a nil value)
Why? What does player.x means in this context? I thought it was “object player’s position relative to the map”…
PS: I wish there is an extensive API doc for dusk engine…