summaryrefslogtreecommitdiff
path: root/main.lua
blob: 4f1e82d2c992080ec96cb2e1756c42182978fb5c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
local loghelper = require("loghelper")
loghelper.strict(loghelper.LEVEL.INFO)

local timer = require("timer.timer")
_G["frame"] = 0

jin.core.onLoad = function()
	timer.every(1.0, function()
		loghelper.log(loghelper.LEVEL.INFO, _G["frame"] .. "fps")
		_G["frame"] = 0
	end)
end 

jin.core.onEvent = function(e)
	if e.type == "quit" then
		jin.core.stop()
	elseif e.type == "keydown" then 
		if e.key == "Escape" then 
			jin.core.stop()
		end 
	end 
end

jin.core.onUpdate = function(dt)
	_G["frame"] = _G["frame"] + 1
	timer.update(dt)
	-- loghelper.log(loghelper.LEVEL.WARN, "版本" .. jin.revision())
end 

jin.core.onDraw = function() 
	
end