From b86be58481c8c986a5a3b285051a6249700bb4cf Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sun, 31 Mar 2019 09:49:54 +0200 Subject: [PATCH] battlesystem: remove old unused background file --- .../battlesystem/controller/background.lua | 81 ------------------- 1 file changed, 81 deletions(-) delete mode 100644 sonic-radiance.love/scenes/battlesystem/controller/background.lua diff --git a/sonic-radiance.love/scenes/battlesystem/controller/background.lua b/sonic-radiance.love/scenes/battlesystem/controller/background.lua deleted file mode 100644 index ee38c55..0000000 --- a/sonic-radiance.love/scenes/battlesystem/controller/background.lua +++ /dev/null @@ -1,81 +0,0 @@ -local Background = Object:extend() - -function Background:new(controller, levelname) - self.controller = controller - local backname = self.controller.datas.background or "city" - local tileline = self.controller.datas.tiles or 1 - local borderline = self.controller.datas.borders or 1 - - self.textures = {} - self.textures.tiles = love.graphics.newImage("assets/backgrounds/normaltile.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.borders = love.graphics.newImage("assets/backgrounds/borders.png") - - self.quads = {} - self.quads.tiles = {} - - local w, h = self.textures.tiles:getDimensions() - self.quads.tiles[1] = love.graphics.newQuad( 0, tileline*24, 40, 24, w, h) - self.quads.tiles[2] = love.graphics.newQuad(40, tileline*24, 40, 24, w, h) - - local w, h = self.textures.borders:getDimensions() - self.quads.borders = love.graphics.newQuad(0, borderline*10, 80, 10, w, h) - - -end - -function Background:destroy() - self.back1:release( ) - self.back2:release( ) -end - -function Background:draw() - local x0, x1, x2 - - local turn = 0 - - x0 = 0 - x1 = x0 / 3 % 240 - x2 = x0 / 9 % 480 - - local sx = 1 - for i=1, 4 do - if (i == 2) or (i == 4) then - love.graphics.draw(self.textures.back1, (i)*240 - x2, 20, 0, -1, 1) - else - love.graphics.draw(self.textures.back1, (i-1)*240 - x2, 20, 0, 1, 1) - end - end - - - for i=1, 7 do - love.graphics.draw(self.textures.borders, self.quads.borders, (i-1)*80, 80, 0, 1, 1) - end - - for i=1, 3 do - love.graphics.draw(self.textures.back2, (i-1)*240 - x1, 20, 0, 1, 1) - end - - --self:drawBorders() - self:drawGround(-8, 86) -end - -function Background:drawGround(x, y) - for i=1, 9 do - for j= -2, 17 do - local k = 1 + ((i + j) % 2) - if (i >= 1) and (i <= 7) and (j >= 1) and (j <= 12) then - love.graphics.setColor(1, 1, 1, 1) - else - love.graphics.setColor(.6,.6,.6, 1) - end - - love.graphics.draw(self.textures.tiles, self.quads.tiles[k], x + (j-1)*31 + (i-1)*10 , y + (i-1)*20) - end - end - - love.graphics.setColor(1, 1, 1, 1) -end - -return Background