Skip to content
Snippets Groups Projects
Commit 92b1d1c6 authored by dg's avatar dg
Browse files

Static map addZone and addSpot can take a 4th parameter that is a table to be...

Static map addZone and addSpot can take a 4th parameter that is a table to be merged into the spot/zone data


git-svn-id: http://svn.net-core.org/repos/t-engine4@2114 51575b47-30f0-44d4-a5cc-537603b46e54
parent c66ae5e8
No related branches found
No related tags found
No related merge requests found
......@@ -79,12 +79,16 @@ function _M:loadMap(file)
checkConnectivity = function(dst, src, type, subtype)
self.spots[#self.spots+1] = {x=dst[1], y=dst[2], check_connectivity=src, type=type or "static", subtype=subtype or "static"}
end,
addSpot = function(dst, type, subtype)
self.spots[#self.spots+1] = {x=dst[1], y=dst[2], type=type or "static", subtype=subtype or "static"}
addSpot = function(dst, type, subtype, additional)
local spot = {x=dst[1], y=dst[2], type=type or "static", subtype=subtype or "static"}
table.update(spot, additional)
self.spots[#self.spots+1] = spot
end,
addZone = function(dst, type, subtype)
addZone = function(dst, type, subtype, additional)
local zone = {x1=dst[1], y1=dst[2], x2=dst[3], y2=dst[4], type=type or "static", subtype=subtype or "static"}
table.update(zone, additional)
self.level.custom_zones = self.level.custom_zones or {}
self.level.custom_zones[#self.level.custom_zones+1] = {x1=dst[1], y1=dst[2], x2=dst[3], y2=dst[4], type=type or "static", subtype=subtype or "static"}
self.level.custom_zones[#self.level.custom_zones+1] = zone
end,
}
setfenv(f, setmetatable(g, {__index=_G}))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment