Mothback/data/scripts/debug.lua

28 lines
1.7 KiB
Lua
Raw Normal View History

2021-10-16 23:06:11 +00:00
function DebugUI()
love.graphics.print("time: "..fps_total..", fps: "..fps_draw..", frametime: "..math.floor(current_dt* 1000).."ms", 10*textScale, 0*textScale, 0, textScale)
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("anim: "..tostring(main_Player.anim.path)..", anim.speed: "..main_Player.anim.speed,10*textScale,120*textScale, 0, textScale)
love.graphics.print("states: \"isOnGround\": "..tostring(main_Player.isOnGround),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(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)
love.graphics.points(-Camera.pos.x + main_Player.pos.x, -Camera.pos.y + main_Player.pos.y)
2021-10-16 23:06:11 +00:00
end
function DebugColisions()
objects.DrawCollisions()
end