fixed map; hookshots circle is now drawn on background

This commit is contained in:
lustlion 2022-02-18 13:21:10 +01:00
parent 37d44ce0a2
commit 192b1e6ca0
5 changed files with 24 additions and 4 deletions

View File

@ -22,14 +22,17 @@ function HookAnchor:New(x,y,hookDistance)
end end
function HookAnchor:HandleAnimation() function HookAnchor:HandleAnimation()
self.body:Animate()
self:Draw(self.body)
end
function HookAnchor:DrawBackground()
love.graphics.circle( love.graphics.circle(
"line", "line",
-Camera.pos.x + self.pos.x, -Camera.pos.x + self.pos.x,
-Camera.pos.y + self.pos.y, -Camera.pos.y + self.pos.y,
self.hookDistance self.hookDistance
) )
self.body:Animate()
self:Draw(self.body)
end end
function HookAnchor:DoPhysics() function HookAnchor:DoPhysics()

View File

@ -248,6 +248,9 @@ function Entity:Debug()
) )
end end
end end
function Entity:DrawBackground()
end
require "code/entities/kupo" require "code/entities/kupo"
require "code/entities/arrow" require "code/entities/arrow"
require "code/entities/decoration" require "code/entities/decoration"

View File

@ -66,14 +66,22 @@ end
function GameDraw() function GameDraw()
-- prepare
GameworldDrawPrepare() GameworldDrawPrepare()
-- background
GameworldDrawBackground() GameworldDrawBackground()
GameworldDrawEntitiesBackground()
-- foreground
GameworldDrawForeground() GameworldDrawForeground()
if LevelData.properties.darkness then if LevelData.properties.darkness then
GameworldDrawLighting() GameworldDrawLighting()
end end
GameworldDrawParticles() GameworldDrawParticles()
GameworldDrawEntities() GameworldDrawEntities()
-- end
GameworldDrawEnd() GameworldDrawEnd()
-- hud -- hud

View File

@ -40,8 +40,14 @@ function GameworldDrawParticles()
end end
end end
function GameworldDrawEntitiesBackground()
for _, enty in pairs(LoadedObjects.Entities) do
enty:DrawBackground()
end
end
function GameworldDrawEntities() function GameworldDrawEntities()
love.graphics.setColor(1,1,1) love.graphics.setColor(0.7,0.7,0.7)
for _, enty in pairs(LoadedObjects.Entities) do for _, enty in pairs(LoadedObjects.Entities) do
enty:HandleAnimation() enty:HandleAnimation()
end end

View File

@ -24,7 +24,7 @@ return {
{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