-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.lua
64 lines (53 loc) · 1.21 KB
/
main.lua
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
require "camera"
require "mouse"
require "graphics"
require "info"
require "layers"
require "inner"
require "gui"
function love.load()
-- set up window
love.graphics.setBackgroundColor(238, 238, 238)
love.window.setMode(love.window.getDesktopDimensions())
load_imgs()
load_txts()
mouse_load()
camera_load()
layers_load()
inner_load()
gui_load()
end
function love.update(dt)
mouse_update(dt)
camera_update(dt)
layers_update(dt)
inner_update(dt)
gui_update(dt)
end
function love.draw()
-- apply camera transformations
love.graphics.push()
love.graphics.translate(screen.w/2, screen.h/2)
love.graphics.scale(camera.zoom, camera.zoom)
love.graphics.translate(-camera.x, -camera.y)
-- draw base / cytoplasm
love.graphics.setColor(255, 255, 255, layers[1].a)
love.graphics.draw(img.cytoplasm)
inner_draw()
layers_draw()
-- stop camera transformations
love.graphics.pop()
-- print info
love.graphics.setColor(255, 255, 255)
gui_draw()
end
function love.mousepressed(x, y, button)
camera_mousepressed(x, y, button)
gui_mousepressed(x, y, button)
if level <= 1 then
inner_mousepressed(x, y, button)
end
end
function love.wheelmoved(x, y)
camera_wheelmoved(x, y)
end