-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.lua
More file actions
41 lines (31 loc) · 700 Bytes
/
Copy pathmain.lua
File metadata and controls
41 lines (31 loc) · 700 Bytes
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
33
34
35
36
37
38
39
40
41
require("globals")
local trainer = require("trainer")
local tickRate = CONFIG.TICK_RATE
local time = 0
function love.load()
math.randomseed(os.time())
trainer:load()
end
function love.update(dt)
time = time + dt
if (time > tickRate) then
trainer:update()
time = 0
end
end
function love.draw()
trainer:render()
end
function love.keypressed(key)
if key == "escape" or key == "q" then
love.event.quit()
end
if key == "-" then
tickRate = tickRate / 2
elseif key == "=" or key == "+" then
tickRate = tickRate * 2
elseif key == "0" then
tickRate = CONFIG.TICK_RATE
end
trainer:keypressed(key)
end