27 lines
806 B
Lua
27 lines
806 B
Lua
local World = require "core.modules.world.world2D"
|
|
local RPGWorld = World:extend()
|
|
local objFile = "scenes.overworld.actors"
|
|
local mapFolder = "datas/gamedata/maps/sti/"
|
|
local RPGMap = require "scenes.overworld.map"
|
|
|
|
function RPGWorld:new(scene, folder, area, playerx, playery)
|
|
--local mapFile = mapFolder .. folder .. "/" .. map .. ".lua"
|
|
self.folder = folder
|
|
self.area = area
|
|
RPGWorld.super.new(self, scene, objFile, nil, nil)
|
|
end
|
|
|
|
|
|
function RPGWorld:createMapController()
|
|
RPGMap(self, self.folder, self.area)
|
|
end
|
|
|
|
function RPGWorld:restoreActions()
|
|
self.encounter:destroy()
|
|
local currentMap = self.map:getMapAtPoint(self.players[1].actor.x, self.players[1].actor.y)
|
|
self.players[1].actor.xsp = 0
|
|
self.players[1].actor.ysp = 0
|
|
self.scene:playMapMusic(currentMap)
|
|
end
|
|
|
|
return RPGWorld
|