diff options
Diffstat (limited to 'main.lua')
-rw-r--r-- | main.lua | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -1,19 +1,18 @@ local loghelper = require("loghelper") loghelper.strict(loghelper.LEVEL.INFO) -local global = require("global.global") local timer = require("timer.timer") -global.set("frame", 0) +_G["frame"] = 0 jin.core.onLoad = function() timer.every(1.0, function() - loghelper.log(loghelper.LEVEL.INFO, global.get("frame") .. "fps") - global.set("frame", 0) + loghelper.log(loghelper.LEVEL.INFO, _G["frame"] .. "fps") + _G["frame"] = 0 end) end jin.core.onEvent = function(e) - if e.type == "quit" then + if e.type == "quit" then jin.core.stop() elseif e.type == "keydown" then if e.key == "Escape" then @@ -23,7 +22,7 @@ jin.core.onEvent = function(e) end jin.core.onUpdate = function(dt) - global.set("frame", _G['frame'] + 1) + _G["frame"] = _G["frame"] + 1 timer.update(dt) -- loghelper.log(loghelper.LEVEL.WARN, "版本" .. jin.revision()) end |