diff --git a/sonic-bluestreak.love/game/modules/gui/frame.lua b/sonic-bluestreak.love/game/modules/gui/frame.lua new file mode 100644 index 0000000..8308cb0 --- /dev/null +++ b/sonic-bluestreak.love/game/modules/gui/frame.lua @@ -0,0 +1,21 @@ +local Frame = Object:extend() + +function Frame:new() + self.guiborder = game.gui.newBorder(424, 20, 6) + self.guiborder2 = game.gui.newBorder(424, 40, 12) + self.emblem = love.graphics.newImage("assets/gui/status/emblem_speedster.png") + self.status = love.graphics.newImage("assets/gui/status/status_bar.png") + +end + +function Frame:draw() + love.graphics.setColor(0.256, 0.632, 0.852, 1) + love.graphics.rectangle("fill", 0, 220, 424, 20) + utils.graphics.resetColor() + love.graphics.draw(self.guiborder, 424, 20, 0, -1, -1) + love.graphics.draw(self.guiborder2, 424, 220, 0, 1, 1, 424, 0) + love.graphics.draw(self.emblem, 8, 8, 0) + love.graphics.draw(self.status, 24, 16, 0) +end + +return Frame diff --git a/sonic-bluestreak.love/game/modules/world/actors/player.lua b/sonic-bluestreak.love/game/modules/world/actors/player.lua index fd8e2c0..47b9e7b 100644 --- a/sonic-bluestreak.love/game/modules/world/actors/player.lua +++ b/sonic-bluestreak.love/game/modules/world/actors/player.lua @@ -2,6 +2,8 @@ local cwd = (...):gsub('%.player$', '') .. "." local Parent = require(cwd .. "parent") local Player = Parent:extend() +local Frame = require("game.modules.gui.frame") + function Player:new(world, x, y, z, id) Player.super.new(self, world, "player", x, y, 0, 16, 12, 24, true) self:setGravity(480*2) @@ -9,9 +11,7 @@ function Player:new(world, x, y, z, id) self:setSprite("sonic", 8, 10) self:cloneSprite() - self.guiborder = game.gui.newBorder(424, 20, 6) - self.emblem = love.graphics.newImage("assets/gui/status/emblem_speedster.png") - self.status = love.graphics.newImage("assets/gui/status/status_bar.png") + self.frame = Frame() self.action = "normal" end @@ -91,9 +91,7 @@ function Player:draw() end function Player:drawHUD(id) - love.graphics.draw(self.guiborder, 424, 20, 0, -1, -1) - love.graphics.draw(self.emblem, 8, 8, 0) - love.graphics.draw(self.status, 24, 16, 0) + self.frame:draw() end return Player diff --git a/sonic-bluestreak.love/game/modules/world/init.lua b/sonic-bluestreak.love/game/modules/world/init.lua index 2a87ef8..920f0b8 100644 --- a/sonic-bluestreak.love/game/modules/world/init.lua +++ b/sonic-bluestreak.love/game/modules/world/init.lua @@ -17,7 +17,7 @@ function RadianceWorld:createMapController() customMap.Battle(self, self.maptype, self.mapname) elseif (self.maptype == "shoot") then customMap.Shoot(self, self.maptype, self.mapname) - self.cameras:lockY(4) + self.cameras:lockY(10) else RadianceWorld.super.createMapController(self) end diff --git a/sonic-bluestreak.love/game/modules/world/maps/battle.lua b/sonic-bluestreak.love/game/modules/world/maps/battle.lua index 930f3c2..3aacc2d 100644 --- a/sonic-bluestreak.love/game/modules/world/maps/battle.lua +++ b/sonic-bluestreak.love/game/modules/world/maps/battle.lua @@ -3,7 +3,7 @@ local BattleMap = BaseMap:extend() function BattleMap:new(world, maptype, mapname) BattleMap.super.new(self, world) - self:setPadding(0, 128, 0, 0) + self:setPadding(0, 128, 0, 20) self.directory = game.utils.getMapDirectory(maptype, mapname) self.mappath = game.utils.getMapPath(maptype, mapname) diff --git a/sonic-bluestreak.love/game/modules/world/maps/shoot.lua b/sonic-bluestreak.love/game/modules/world/maps/shoot.lua index a0c96e9..23eeb62 100644 --- a/sonic-bluestreak.love/game/modules/world/maps/shoot.lua +++ b/sonic-bluestreak.love/game/modules/world/maps/shoot.lua @@ -91,7 +91,6 @@ function ShootMap:addParallax(filename) filename = backfolder .. filename self.texture.back1 = love.graphics.newImage(filename .. "-back.png") self.texture.back2 = love.graphics.newImage(filename .. "-fore.png") - self.texture.cliff = love.graphics.newImage(filename .. "-cliff.png") end function ShootMap:drawParallax(x, y, w, h) @@ -106,7 +105,6 @@ function ShootMap:drawParallax(x, y, w, h) self:drawBorder(x, y + 10) self:drawBorder(x, y - 100) - self:drawCliff(x, y - 110, w, h) end function ShootMap:drawBackground(x, y, w, h)