]> Untitled Git - lightcycles-love.git/blobdiff - main.lua
Removed debug print and vector from player
[lightcycles-love.git] / main.lua
index b4dd09cfb30ff9a5cba51596a5410b7f9b3fc4bf..2995ef8583f63a1ee800c5791ea33a3cf08708ac 100644 (file)
--- a/main.lua
+++ b/main.lua
@@ -1,13 +1,18 @@
 -- main
 
 -- main
 
+require 'player'
+
 function love.load()
 function love.load()
+    player = Player:new({position={x=100, y=100}, vector={x=Player.acceleration, y=0}})
 end
 
 function love.draw()
     -- set bg
 end
 
 function love.draw()
     -- set bg
-    love.graphics.setBackgroundColor(0.2, 0.2, 0.5)
+    local bgcolor = {0.2, 0.2, 0.5}
+    love.graphics.setBackgroundColor(bgcolor)
 
     -- draw basic grid
 
     -- draw basic grid
+    love.graphics.setColor(0.3, 0.3, 0.6)
     local width = love.graphics.getWidth()
     local height = love.graphics.getHeight()
     local delta = 50
     local width = love.graphics.getWidth()
     local height = love.graphics.getHeight()
     local delta = 50
@@ -19,10 +24,19 @@ function love.draw()
     for y=0,height,delta do
         love.graphics.line(0, y, width, y)
     end
     for y=0,height,delta do
         love.graphics.line(0, y, width, y)
     end
+
+    -- misc
+    player:draw()
 end
 
 function love.update(dt)
     if love.keyboard.isDown('escape') then
         love.event.quit()
     end
 end
 
 function love.update(dt)
     if love.keyboard.isDown('escape') then
         love.event.quit()
     end
+    player:update(dt)
+end
+
+function love.quit()
+    print('Thanks for playing!')
+    print('Recorded ' .. #player.path / 2 .. ' player path points')
 end
 end