sonic-radiance/sonic-radiance.love/scenes/overworld/actors/player/map.lua

17 lines
No EOL
410 B
Lua

local PlayerMap = Object:extend()
function PlayerMap:initMap()
self.previousMap = 0
end
function PlayerMap:updateCurrentMap()
local currentMap = self.world.map:getMapAtPoint(self.x, self.y)
if (currentMap ~= nil) then
if (self.previousMap ~= currentMap.id) then
self.previousMap = currentMap.id
self.scene:updateCurrentMap(currentMap)
end
end
end
return PlayerMap