X-Git-Url: http://git.purplebirdman.com/lightcycles-love.git/blobdiff_plain/0c014b54ddd52d3ca1ed007a7c2562dfa9514c99..a32b179f4401624b1f9404bb31bf9c547641da14:/main.lua diff --git a/main.lua b/main.lua index c364b13..a0d0ca7 100644 --- a/main.lua +++ b/main.lua @@ -1,43 +1,23 @@ -- main -require 'vec2' -require 'player' +require 'scene' function love.load() - player = Player:new({position=vec2:new(100,100), vector=Player.vectors.right}) + scene:load() end function love.draw() - -- set bg - 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 - - 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 - - -- misc - player:draw() + scene:draw() end function love.update(dt) if love.keyboard.isDown('escape') then love.event.quit() end - player:update(dt) + scene:update(dt) end function love.quit() print('Thanks for playing!') - print('Recorded ' .. #player.path / 2 .. ' player path points') + scene:quit() end