From b0a665f16aa241c2f8650d1040bab42faa2a75bc Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 1 Aug 2018 20:29:30 +0800 Subject: *update --- main.lua | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'main.lua') 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 -- cgit v1.1-26-g67d0