From 83e8a68d03ef3d5d57dd35d2ece7890a0c6f2e83 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Tue, 13 Aug 2019 19:13:17 +0200 Subject: [PATCH] improvement: adapt oldcbs to new shadow shoot style --- .../battlesystem/controller/battlearena.lua | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/sonic-radiance.love/scenes/battlesystem/controller/battlearena.lua b/sonic-radiance.love/scenes/battlesystem/controller/battlearena.lua index f4b88ee..6d617b4 100644 --- a/sonic-radiance.love/scenes/battlesystem/controller/battlearena.lua +++ b/sonic-radiance.love/scenes/battlesystem/controller/battlearena.lua @@ -12,7 +12,7 @@ local EmptyArena = { local _GROUND_X, _GROUND_Y _GROUND_X = -8 -_GROUND_Y = 70 +_GROUND_Y = 90 function BattleArena:new(controller) self.controller = controller @@ -47,6 +47,7 @@ function BattleArena:loadRessources() self.textures.sptiles = love.graphics.newImage("assets/backgrounds/specialtile.png") self.textures.back1 = love.graphics.newImage("assets/backgrounds/parallax/" .. backname .. "-back.png") self.textures.back2 = love.graphics.newImage("assets/backgrounds/parallax/" .. backname .. "-fore.png") + self.textures.cliff = love.graphics.newImage("assets/backgrounds/parallax/" .. backname .. "-cliff.png") self.textures.borders = love.graphics.newImage("assets/backgrounds/borders.png") self.textures.shadow = love.graphics.newImage("assets/sprites/shadow.png") @@ -152,22 +153,25 @@ function BattleArena:drawShadows() end function BattleArena:drawBackgrounds() - for i=1, 4 do - if (i == 2) or (i == 4) then - love.graphics.draw(self.textures.back1, (i)*240, 0, 0, -1, 1) - else - love.graphics.draw(self.textures.back1, (i-1)*240, 0, 0, 1, 1) - end + local w, _ = core.screen:getDimensions() + + local w2, h2 = self.textures.back1:getDimensions() + local imax = math.ceil(w / w2) + 1 + for i=1, imax do + love.graphics.draw(self.textures.back1, (i-1)*w2, 0, 0, 1, 1) end - for i=1, 3 do - love.graphics.draw(self.textures.back2, (i-1)*240, 0, 0, 1, 1) + local w2, h2 = self.textures.back2:getDimensions() + local imax = math.ceil(w / w2) + 1 + for i=1, imax do + love.graphics.draw(self.textures.back2, (i-1)*w2, _GROUND_Y-h2, 0, 1, 1) end end function BattleArena:drawBorder() for i=1, 7 do - love.graphics.draw(self.textures.borders, self.quads.borders, (i-1)*80, 60, 0, 1, 1) + love.graphics.draw(self.textures.borders, self.quads.borders, (i-1)*80, _GROUND_Y-10, 0, 1, 1) + love.graphics.draw(self.textures.borders, self.quads.borders, (i-1)*80, _GROUND_Y+20*7, 0, 1, 1) end end @@ -176,7 +180,7 @@ function BattleArena:drawTerrains() vl = 1 vhd = .7 vd = .5 - for i=1, 9 do + for i=1, 7 do for j= -2, 17 do local k = 1 + ((i + j) % 2)