UpTime Native Extension for the Defold Game Engine
This Defold Native Extension allows receiving a system uptime. This timer resets when user restarts their device!
- If you want to use a timer for restore lives (or something else) in your game without server but want to have better protection against cheaters who just change system time.
- Seed for math.randomseed() (thanks @dragosha for that use case idea)
- iOS
- MacOS
- Android
- Windows
To use this library in your Defold project, add the needed version URL to your game.project
dependencies from Releases
Returns system uptime in seconds.
local function update_uptime(self)
if uptime then
local uptime = uptime.get()
print(uptime) -- 809031
end
end
If you have any issues, questions or suggestions please create an issue or contact me: [email protected]