improvement: adapt oldcbs to new shadow shoot style

This commit is contained in:
Kazhnuz 2019-08-13 19:13:17 +02:00
parent 6c91fbe9ef
commit 83e8a68d03

View file

@ -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)