summaryrefslogtreecommitdiffhomepage
path: root/main.lua
diff options
context:
space:
mode:
Diffstat (limited to 'main.lua')
-rw-r--r--main.lua47
1 files changed, 19 insertions, 28 deletions
diff --git a/main.lua b/main.lua
index 575b7c8..1163516 100644
--- a/main.lua
+++ b/main.lua
@@ -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