-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.lua
More file actions
40 lines (32 loc) · 774 Bytes
/
Copy pathmain.lua
File metadata and controls
40 lines (32 loc) · 774 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
require "advanced-mouse-input"
require "background"
require "draggable-square"
require "top-bar"
local advancedMouseInput = AdvancedMouseInput:create()
love.mouse.horizontalScrollButtons = { "lshift", "rshift" }
local objects = {
-- Top
TopBar:create(),
DraggableSquare:create(100, 200),
DraggableSquare:create(120, 150),
Background:create(),
-- Bottom
}
--- LOVE update handler
function love.update()
if love.keyboard.isDown("escape") then
love.event.quit()
end
advancedMouseInput:beforeUpdate()
for i = 1, #objects do
objects[i]:update()
end
advancedMouseInput:afterUpdate()
end
--- LOVE draw handler
function love.draw()
for i = #objects, 1, -1 do
objects[i]:draw()
end
advancedMouseInput:draw()
end