From 00097ac5d97bfac9d96ddc52629071aed45ef4cc Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sat, 28 Dec 2019 13:25:45 +0100 Subject: [PATCH] improvement: get shoot map data from its zone file --- sonic-bluestreak.love/datas/gamedata/maps/shoot/zones.lua | 7 ------- sonic-bluestreak.love/game/modules/world/maps/shoot.lua | 4 +++- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/sonic-bluestreak.love/datas/gamedata/maps/shoot/zones.lua b/sonic-bluestreak.love/datas/gamedata/maps/shoot/zones.lua index 75e10b0..40eea73 100644 --- a/sonic-bluestreak.love/datas/gamedata/maps/shoot/zones.lua +++ b/sonic-bluestreak.love/datas/gamedata/maps/shoot/zones.lua @@ -1,44 +1,37 @@ return { ["forest"] = { name = "Jade Forest", - borders = 0, tiles = 0, background = "forest" }, ["city"] ={ name = "Diamond Highway", - borders = 1, tiles = 1, background = "city" }, ["tunnel"] ={ name = "Peridot Tunnel", - borders = 2, tiles = 2, background = "tunnel", music = nil }, ["mountain"] ={ name = "Pearl Mountain", - borders = 3, tiles = 3, background = "mountain" }, ["hills"] ={ name = "Calcite Hills", - borders = 4, tiles = 4, background = "hills" }, ["bridge"] ={ name = "Carnelian Bridge", - borders = 5, tiles = 5, background = "bridge" }, ["castle"] ={ name = "Ametist Castle", - borders = 6, tiles = 6, background = "castle", music = nil diff --git a/sonic-bluestreak.love/game/modules/world/maps/shoot.lua b/sonic-bluestreak.love/game/modules/world/maps/shoot.lua index 402add1..a0c96e9 100644 --- a/sonic-bluestreak.love/game/modules/world/maps/shoot.lua +++ b/sonic-bluestreak.love/game/modules/world/maps/shoot.lua @@ -10,7 +10,9 @@ function ShootMap:new(world, maptype, mapname) ShootMap.super.new(self, world) 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 function ShootMap:loadCollisions()