diff options
author | chai <chaifix@163.com> | 2018-08-01 20:29:30 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-08-01 20:29:30 +0800 |
commit | b0a665f16aa241c2f8650d1040bab42faa2a75bc (patch) | |
tree | 0edb83f2a3495c7009927bc6c026c72f9db91247 /main.lua | |
parent | 5f9dc5209d621d6ce7d27936a24b23589142d0ae (diff) |
*update
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 |