-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathRegion.lua
43 lines (43 loc) · 1.15 KB
/
Region.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
---
--- Created by ttwings.
--- DateTime: 2017/10/20 0:58
--- 区域场景数据
--- @class Region
local Class = require("lib.middleclass")
Region = Class("Region",GameObject)
function Region:init(name)
self.npc = require("assets/data/" .. name .."Npc")
self.room = require("assets/data/" .. name .."Room")
self.obj = require("assets/data/" .. name .."Obj")
self.map = require("assets/data/" .. name .."Map")
end
--local r = {}
--Region = r
function Region:load(name)
self.npc = require("assets/data/" .. name .."Npc")
self.room = require("assets/data/" .. name .."Room")
self.obj = require("assets/data/" .. name .."Obj")
self.map = require("assets/data/" .. name .."Map")
end
function Region:update(dt)
-- TODO
-- self.map:update(dt)
end
function Region:draw()
self.map:draw()
end
--function Region:readData(data)
-- for k, v in pairs(data) do
-- self[k] = v
-- end
--end
--Region = {}
--Region.name="襄阳武馆"
---- 地图初始化时,可以把物品保存到这里
--Region.objs={}
------ 保存人物信息
--Region.actors={}
---- 保存工作信息
--Region.jobs={}
--Region.tiledMap = "wuguan"
return Region