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
function HookAnchor:HandleAnimation()
self.body:Animate()
self:Draw(self.body)
end
function HookAnchor:DrawBackground()
love.graphics.circle(
"line",
-Camera.pos.x + self.pos.x,
-Camera.pos.y + self.pos.y,
self.hookDistance
)
self.body:Animate()
self:Draw(self.body)
end
function HookAnchor:DoPhysics()

View File

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

View File

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

View File

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

View File

@ -24,7 +24,7 @@ return {
{ 1, 1, 1, 1, 1, 1, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{ 1, 1, 1, 1, 1, 1, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{ 1, 1, 1, 1, 1, 1, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{ 1, 1, 1, 1, 1, 1, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{ 1, 1, 1, 1, 1, 1, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{ 1, 1, 1, 1, 1, 1, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{ 1, 1, 1, 1, 1, 1, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
},