-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.lua
45 lines (34 loc) · 1.05 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
-- main.lua is for Love2D (https://love2d.org)
-- Love2D: use "local-lua-debugger-vscode" only if launched through "ms-vscode"
if os.getenv("LOCAL_LUA_DEBUGGER_VSCODE") == "1" then
-- don't use debugging unless launched through "lldebugger" (ms-vscode)
require("lldebugger").start()
end
---require('common-preceding')
if love == nil then
-- not using Love2D
print("USAGE ERROR: run it with Love2D (get it at love2d.org)")
os.exit(1)
end
function love.load()
-- from: http://notebook.kulchenko.com/zerobrane/love2d-debugging
if arg[#arg] == "-debug" then require("mobdebug").start() end
love.window.setTitle("[arkenidar/graphic] love .")
love.window.setMode(300, 300)
end
require('common')
--------------------------------------
-- love2d.org specificities
--------------------------------------
function love.update(dt)
update(dt)
end
function draw_pixel(rgb, xy)
love.graphics.setColor(rgb[1], rgb[2], rgb[3], 1)
-- draw pixel
local px, py = xy[1], xy[2]
love.graphics.rectangle("fill", px, py, 1, 1)
end
function love.draw()
draw()
end