X-Git-Url: http://git.purplebirdman.com/lightcycles-love.git/blobdiff_plain/275e7cac67f586378a29067b98a689ab5ac62ced..49619a3f3f26e831923e425ad7ecf1cd08520212:/main.lua diff --git a/main.lua b/main.lua index b4dd09c..c364b13 100644 --- a/main.lua +++ b/main.lua @@ -1,13 +1,19 @@ -- main +require 'vec2' +require 'player' + function love.load() + player = Player:new({position=vec2:new(100,100), vector=Player.vectors.right}) 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 + love.graphics.setColor(0.3, 0.3, 0.6) local width = love.graphics.getWidth() local height = love.graphics.getHeight() local delta = 50 @@ -19,10 +25,19 @@ function love.draw() 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 + player:update(dt) +end + +function love.quit() + print('Thanks for playing!') + print('Recorded ' .. #player.path / 2 .. ' player path points') end