-
Notifications
You must be signed in to change notification settings - Fork 0
ProgramCore
Thomas2889 edited this page Aug 15, 2021
·
1 revision
local Core = require("ProgramCore")
-- This will attempt to run the loop 1 time per second
Core.targetTPS = 1
local function Main()
-- Print the delta every loop (should be something equal to 1, as delta is measured in seconds)
print(Core.delta)
-- Note TestForExitCondition isn't part of the library. This is just to show off your program
-- testing for an exit condition
if TestForExitCondition() then
Core.running = false
end
end
-- Run the main program loop. Will stop once Core.running is set to false
Core.Run(Main)-
Run(callback)Will run the main loop and call the callback every time -
targetTPSThis is the target ticks per second of the program. -
runningThis is the running status of the program. It is set to true when Run() is called. Once set to false the loop will exit. -
deltaThis is updated before the callback is called every loop and is the number of seconds since the last loop.