Mothback/data/scripts/debug.lua

48 lines
2.2 KiB
Lua
Raw Normal View History

2021-10-16 23:06:11 +00:00
function DebugUI()
2021-10-25 23:19:22 +00:00
local mouse_x, mouse_y = love.mouse.getPosition()
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)
end
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
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)
love.graphics.print("scale: {"..main_Player.sprite_scale.x..", "..main_Player.sprite_scale.y.."}",10*textScale,100*textScale, 0, textScale)
love.graphics.print("states: \"isOnGround\": "..tostring(main_Player.isOnGround),10*textScale,120*textScale, 0, textScale)
love.graphics.print("\"coyoteValue\": "..tostring(main_Player.coyoteValue),10*textScale,140*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("[Cursor]",10*textScale,220*textScale, 0, textScale)
love.graphics.print("position: {"..mouse_x+Camera.pos.x..", "..mouse_y+Camera.pos.y.."}",10*textScale,240*textScale, 0, textScale)
2021-10-16 23:06:11 +00:00
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()
LoadedObjects.DrawCollisions()
2021-10-16 23:06:11 +00:00
end
function DebugEntities()
for _, particle in pairs(LoadedParticles) do
particle:Debug()
end
for _, enty in pairs(LoadedEntities) do
enty:Debug()
end
end