diff options
author | Aki <nthirtyone@gmail.com> | 2016-12-20 06:05:56 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-20 06:05:56 +0100 |
commit | 493a89fb354ee6ce667d29a7b96bb4fdd0f6697f (patch) | |
tree | d862856d4b62a6c996ea16211ebd321206e236b4 /main.lua | |
parent | ed6ad6687aeb5359af48bc97c1dbf5dd66842c9c (diff) | |
parent | 73bcd524906c51d43b22b3ea68c64b38f130bea6 (diff) | |
download | roflnauts-493a89fb354ee6ce667d29a7b96bb4fdd0f6697f.zip roflnauts-493a89fb354ee6ce667d29a7b96bb4fdd0f6697f.tar.gz roflnauts-493a89fb354ee6ce667d29a7b96bb4fdd0f6697f.tar.bz2 |
Merge pull request #16 from nthirtyone/menuv1.0-pre.4
Menu
Diffstat (limited to 'main.lua')
-rw-r--r-- | main.lua | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -39,12 +39,12 @@ require "camera" require "menu" require "controller" require "music" +require "settings" -- Temporary debug debug = false -- LÖVE2D callbacks --- Load function love.load() -- Graphics love.graphics.setBackgroundColor(90, 90, 90) @@ -54,28 +54,30 @@ function love.load() Bold = love.graphics.newImageFont("assets/font-big.png", " 0123456789AEFILNORSTUW", -2) Font:setLineHeight(9/16) love.graphics.setFont(Font) - -- Controller + -- Modules Controller.load() + Settings.load() -- Scene Scene = Menu:new() end --- Update function love.update(dt) Scene:update(dt) end --- Draw function love.draw() Scene:draw() if debug then local scale = getScale() + love.graphics.setFont(Font) love.graphics.setColor(255, 0, 0, 255) love.graphics.print("Debug ON", 10, 10, 0, scale, scale) love.graphics.setColor(255, 255, 255, 255) love.graphics.print("Current FPS: "..tostring(love.timer.getFPS()), 10, 10+9*scale, 0, scale, scale) end end +function love.quit() + Settings.save() +end -- Pass input to Controller -function love.joystickadded(joystick) Controller.joystickadded(joystick) end function love.gamepadaxis(joystick, axis, value) Controller.gamepadaxis(joystick, axis, value) end function love.gamepadpressed(joystick, key) Controller.gamepadpressed(joystick, key) end function love.gamepadreleased(joystick, key) Controller.gamepadreleased(joystick, key) end @@ -87,7 +89,7 @@ function Controller.controlpressed(set, action, key) -- pass to current Scene Scene:controlpressed(set, action, key) -- globals - if key == "escape" or key == "f1" then + if key == "escape" then love.event.quit() end if key == "f5" then @@ -97,6 +99,4 @@ end function Controller.controlreleased(set, action, key) -- pass to current Scene Scene:controlreleased(set, action, key) -end - - +end
\ No newline at end of file |