2021-10-16 23:06:11 +00:00
|
|
|
function DebugUI()
|
2021-10-25 23:19:22 +00:00
|
|
|
|
2021-10-29 02:15:53 +00:00
|
|
|
for _, light in pairs(Lights) do
|
2021-10-25 23:19:22 +00:00
|
|
|
love.graphics.print(light.pos.x,light.pos.x,light.pos.y)
|
|
|
|
love.graphics.print(light.pos.y,light.pos.x,light.pos.y+20)
|
|
|
|
love.graphics.print(light.pos.x,light.pos.x,light.pos.y+40)
|
2021-10-29 02:15:53 +00:00
|
|
|
end
|
|
|
|
|
2021-11-28 02:38:30 +00:00
|
|
|
love.graphics.print("time: "..fps_total..", fps: "..fps_draw..", frametime: "..math.floor(current_dt* 1000).."ms", 10*textScale, 0*textScale, 0, textScale)
|
2021-10-16 23:06:11 +00:00
|
|
|
|
|
|
|
love.graphics.setColor(1,1,1)
|
|
|
|
-- lots of variables
|
2021-10-22 16:23:05 +00:00
|
|
|
love.graphics.print("[main_Player]",10*textScale,40*textScale, 0, textScale)
|
|
|
|
love.graphics.print("position: {"..main_Player.pos.x..", "..main_Player.pos.y.."}",10*textScale,60*textScale, 0, textScale)
|
|
|
|
love.graphics.print("velocity: {"..main_Player.vel.x..", "..main_Player.vel.y.."}",10*textScale,80*textScale, 0, textScale)
|
2021-10-24 23:41:40 +00:00
|
|
|
love.graphics.print("scale: {"..main_Player.sprite_scale.x..", "..main_Player.sprite_scale.y.."}",10*textScale,100*textScale, 0, textScale)
|
2021-10-29 02:15:53 +00:00
|
|
|
love.graphics.print("states: \"isOnGround\": "..tostring(main_Player.isOnGround),10*textScale,120*textScale, 0, textScale)
|
2021-10-16 23:06:11 +00:00
|
|
|
|
|
|
|
love.graphics.print("[Camera]",10*textScale,160*textScale, 0, textScale)
|
|
|
|
love.graphics.print("position: {"..Camera.pos.x..", "..Camera.pos.y.."}",10*textScale,180*textScale, 0, textScale)
|
|
|
|
love.graphics.print("size: {"..Camera.width..", "..Camera.height.."}",10*textScale,200*textScale, 0, textScale)
|
|
|
|
|
|
|
|
love.graphics.print(textScale,10*textScale,240*textScale, 0, textScale)
|
|
|
|
love.graphics.print("Level: "..levelNum.." / "..#levelList.." \""..currLevel.."\"",10*textScale,260*textScale, 0, textScale)
|
|
|
|
|
|
|
|
-- player isOnGroundCheck
|
|
|
|
love.graphics.setColor(1,0,0)
|
|
|
|
end
|
|
|
|
|
|
|
|
function DebugColisions()
|
2022-01-22 22:10:21 +00:00
|
|
|
LoadedObjects.DrawCollisions()
|
2021-10-16 23:06:11 +00:00
|
|
|
end
|
2021-11-28 02:38:30 +00:00
|
|
|
|
|
|
|
function DebugEntities()
|
2022-01-21 14:56:25 +00:00
|
|
|
for _, particle in pairs(LoadedParticles) do
|
|
|
|
-- draw center CYAN
|
|
|
|
love.graphics.setColor(0,1,1)
|
|
|
|
love.graphics.circle("fill", -Camera.pos.x + particle.pos.x, -Camera.pos.y + particle.pos.y, 1)
|
|
|
|
|
|
|
|
end
|
2021-11-28 02:38:30 +00:00
|
|
|
for _, enty in pairs(LoadedEntities) do
|
|
|
|
-- draw center GREEN
|
|
|
|
love.graphics.setColor(0,1,0)
|
|
|
|
love.graphics.circle("fill", -Camera.pos.x + enty.pos.x, -Camera.pos.y + enty.pos.y, 1)
|
|
|
|
-- draw collision box PURPLE
|
2022-01-17 23:14:54 +00:00
|
|
|
love.graphics.setColor(1,0,1)
|
|
|
|
love.graphics.rectangle(
|
|
|
|
"line",
|
|
|
|
-Camera.pos.x + enty.pos.x + enty.boxCollision.from.x,
|
|
|
|
-Camera.pos.y + enty.pos.y + enty.boxCollision.from.y,
|
|
|
|
-Camera.pos.x + enty.pos.x + enty.boxCollision.to.x -(-Camera.pos.x + enty.pos.x + enty.boxCollision.from.x),
|
|
|
|
-Camera.pos.y + enty.pos.y + enty.boxCollision.to.y -(-Camera.pos.y + enty.pos.y + enty.boxCollision.from.y)
|
2021-11-28 02:38:30 +00:00
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|