improvement: get shoot map data from its zone file

This commit is contained in:
Kazhnuz 2019-12-28 13:25:45 +01:00
parent c35fcb7c5c
commit 00097ac5d9
2 changed files with 3 additions and 8 deletions

View file

@ -1,44 +1,37 @@
return { return {
["forest"] = { ["forest"] = {
name = "Jade Forest", name = "Jade Forest",
borders = 0,
tiles = 0, tiles = 0,
background = "forest" background = "forest"
}, },
["city"] ={ ["city"] ={
name = "Diamond Highway", name = "Diamond Highway",
borders = 1,
tiles = 1, tiles = 1,
background = "city" background = "city"
}, },
["tunnel"] ={ ["tunnel"] ={
name = "Peridot Tunnel", name = "Peridot Tunnel",
borders = 2,
tiles = 2, tiles = 2,
background = "tunnel", background = "tunnel",
music = nil music = nil
}, },
["mountain"] ={ ["mountain"] ={
name = "Pearl Mountain", name = "Pearl Mountain",
borders = 3,
tiles = 3, tiles = 3,
background = "mountain" background = "mountain"
}, },
["hills"] ={ ["hills"] ={
name = "Calcite Hills", name = "Calcite Hills",
borders = 4,
tiles = 4, tiles = 4,
background = "hills" background = "hills"
}, },
["bridge"] ={ ["bridge"] ={
name = "Carnelian Bridge", name = "Carnelian Bridge",
borders = 5,
tiles = 5, tiles = 5,
background = "bridge" background = "bridge"
}, },
["castle"] ={ ["castle"] ={
name = "Ametist Castle", name = "Ametist Castle",
borders = 6,
tiles = 6, tiles = 6,
background = "castle", background = "castle",
music = nil music = nil

View file

@ -10,7 +10,9 @@ function ShootMap:new(world, maptype, mapname)
ShootMap.super.new(self, world) ShootMap.super.new(self, world)
self:setPadding(0, 0, 0, 0) self:setPadding(0, 0, 0, 0)
self:generateTextures(5, mapname) self.textureId = zoneDatas[mapname].tiles
self.background = zoneDatas[mapname].background
self:generateTextures(self.textureId, self.background)
end end
function ShootMap:loadCollisions() function ShootMap:loadCollisions()