summaryrefslogtreecommitdiff
path: root/main.lua
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2018-08-01 20:29:30 +0800
committerchai <chaifix@163.com>2018-08-01 20:29:30 +0800
commitb0a665f16aa241c2f8650d1040bab42faa2a75bc (patch)
tree0edb83f2a3495c7009927bc6c026c72f9db91247 /main.lua
parent5f9dc5209d621d6ce7d27936a24b23589142d0ae (diff)
*update
Diffstat (limited to 'main.lua')
-rw-r--r--main.lua11
1 files changed, 5 insertions, 6 deletions
diff --git a/main.lua b/main.lua
index 3de3228..4f1e82d 100644
--- a/main.lua
+++ b/main.lua
@@ -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