summaryrefslogtreecommitdiffhomepage
path: root/main.lua
diff options
context:
space:
mode:
authorAki <nthirtyone@gmail.com>2016-06-04 15:14:05 +0200
committerAki <nthirtyone@gmail.com>2016-06-04 15:14:05 +0200
commit3787499248fdc2d2b881b20779911733eb2678ad (patch)
tree845877c4041999a22be9c5540b2dc6359189e9e9 /main.lua
parent26bdffd66e2b33b2dc75bbe6e3701541df6181da (diff)
downloadroflnauts-3787499248fdc2d2b881b20779911733eb2678ad.zip
roflnauts-3787499248fdc2d2b881b20779911733eb2678ad.tar.gz
roflnauts-3787499248fdc2d2b881b20779911733eb2678ad.tar.bz2
Menu actually works now
Diffstat (limited to 'main.lua')
-rw-r--r--main.lua24
1 files changed, 11 insertions, 13 deletions
diff --git a/main.lua b/main.lua
index da4c378..8e2a964 100644
--- a/main.lua
+++ b/main.lua
@@ -9,6 +9,12 @@ require "controller"
-- Temporary debug
debug = false
+-- Pretend you didn't see this
+Scene = nil
+function changeScene(scene)
+ Scene = scene
+end
+
-- Load
function love.load ()
-- Graphics
@@ -34,14 +40,13 @@ function love.load ()
m:assignController(Controllers[1])
m:assignController(Controllers[2])
- -- ZU WARUDO!
- w = World:new("default", {"leon", Controllers[1]}, {"lonestar", Controllers[2]})
+ -- Scene
+ changeScene(m)
end
-- Update
function love.update (dt)
- w:update(dt)
- -- m:update(dt)
+ Scene:update(dt)
end
-- KeyPressed
@@ -59,13 +64,7 @@ function love.keypressed (key)
end
if key == "f5" and debug then
local new = World:new("default", {"leon", Controllers[1]}, {"lonestar", Controllers[2]})
- -- m = nil
- -- m = new
- w = nil
- w = new
- end
- if key == "f6" then
- m = m:startGame()
+ changeScene(new)
end
end
@@ -79,8 +78,7 @@ end
-- Draw
function love.draw ()
- w:draw()
- -- m:draw()
+ Scene:draw()
if debug then
love.graphics.print("Current FPS: "..tostring(love.timer.getFPS( )), 10, 10)
end