diff options
Diffstat (limited to 'main.lua')
-rw-r--r-- | main.lua | 47 |
1 files changed, 19 insertions, 28 deletions
@@ -8,8 +8,6 @@ require "controller" -- Temporary debug debug = false -third = nil --"clunk" -fourth = nil --"yuri" -- Load function love.load () @@ -22,36 +20,28 @@ function love.load () Font:setLineHeight(1) love.graphics.setFont(Font) - -- ZU WARUDO! - w = World:new("default", "leon", "lonestar", third, fourth) - -- Menu bijaczes - -- m = Menu:new() - -- m:newSelector() - -- m:newSelector() - -- m:newSelector() - -- m:newSelector() - -- m.selectors[1]:setPosition(40+33*1,33) - -- m.selectors[2]:setPosition(40+33*2,33) - -- m.selectors[3]:setPosition(40+33*3,33) - -- m.selectors[4]:setPosition(40+33*4,33) + m = Menu:new() + m:newSelector() + m:newSelector() + m:newSelector() + m:newSelector() -- Controllers Controllers = {} table.insert(Controllers, Controller:new()) table.insert(Controllers, Controller:new(nil, "a", "d", "w", "s", "g", "h")) - w.Nauts[1]:assignController(Controllers[1]) - w.Nauts[2]:assignController(Controllers[2]) + m:assignController(Controllers[1]) + m:assignController(Controllers[2]) - -- Menu Controllers - -- m:assignController(Controllers[1]) - -- m:assignController(Controllers[2]) + -- ZU WARUDO! + -- w = World:new("default", {"leon", Controllers[1]}, {"lonestar", Controllers[2]}) end -- Update function love.update (dt) - w:update(dt) - -- m:update(dt) + -- w:update(dt) + m:update(dt) end -- KeyPressed @@ -68,11 +58,12 @@ function love.keypressed (key) love.event.quit() end if key == "f5" and debug then - local new = World:new("default", "leon", "lonestar", third, fourth) - w = nil - w = new - w.Nauts[1]:assignController(cont1) - w.Nauts[2]:assignController(cont2) + local new = World:new("default", {"leon", Controllers[1]}, {"lonestar", Controllers[2]}) + m = nil + m = new + end + if key == "f6" then + m = m:startGame() end end @@ -86,8 +77,8 @@ end -- Draw function love.draw () - w:draw() - -- m:draw() + -- w:draw() + m:draw() if debug then love.graphics.print("Current FPS: "..tostring(love.timer.getFPS( )), 10, 10) end |