Tesseract-Engine/assets/scripts/script.lua

37 lines
682 B
Lua
Raw Normal View History

2024-12-27 21:27:05 +00:00
-- script.lua
local itterator = 0
local ticks = 0
function OnInit()
-- Log a message with a custom red color
Engine.Log("This is a red message.", {1.0, 0.0, 0.0, 1.0})
-- Log a message with a custom green color
Engine.Log("This is a green message.", {0.0, 1.0, 0.0, 1.0})
-- Log a message with a custom blue color
Engine.Log("This is a blue message.", {0.0, 0.0, 1.0, 1.0})
2024-12-27 21:27:05 +00:00
end
function OnUpdate(deltaTime)
2024-12-27 22:15:40 +00:00
2024-12-27 21:27:05 +00:00
ticks = ticks + 1
2024-12-27 22:15:40 +00:00
local timestep = 5
if itterator >= timestep then
Engine.Log("TPS: ".. (ticks/timestep))
2024-12-27 21:27:05 +00:00
ticks = 0
itterator = 0
end
2024-12-27 22:15:40 +00:00
2024-12-27 21:27:05 +00:00
itterator = itterator + deltaTime
2024-12-27 22:15:40 +00:00
2024-12-27 21:27:05 +00:00
end