]> Untitled Git - lightcycles-love.git/commitdiff
Added basic grid
authorClifton James Palmer <clifton.palmer@gmail.com>
Fri, 7 Dec 2018 23:13:38 +0000 (17:13 -0600)
committerClifton James Palmer <clifton.palmer@gmail.com>
Fri, 7 Dec 2018 23:13:38 +0000 (17:13 -0600)
main.lua [new file with mode: 0644]

diff --git a/main.lua b/main.lua
new file mode 100644 (file)
index 0000000..b4dd09c
--- /dev/null
+++ b/main.lua
@@ -0,0 +1,28 @@
+-- main
+
+function love.load()
+end
+
+function love.draw()
+    -- set bg
+    love.graphics.setBackgroundColor(0.2, 0.2, 0.5)
+
+    -- draw basic grid
+    local width = love.graphics.getWidth()
+    local height = love.graphics.getHeight()
+    local delta = 50
+
+    for x=0,width,delta do
+        love.graphics.line(x, 0, x, height)
+    end
+
+    for y=0,height,delta do
+        love.graphics.line(0, y, width, y)
+    end
+end
+
+function love.update(dt)
+    if love.keyboard.isDown('escape') then
+        love.event.quit()
+    end
+end