diff options
Diffstat (limited to 'scripts/loadSaveQuit.lua')
-rw-r--r-- | scripts/loadSaveQuit.lua | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/scripts/loadSaveQuit.lua b/scripts/loadSaveQuit.lua new file mode 100644 index 0000000..8d5f353 --- /dev/null +++ b/scripts/loadSaveQuit.lua @@ -0,0 +1,13 @@ +local glfw = honey.glfw + +return function(entities, id, data) + if data.action == glfw.PRESS then + if data.key == glfw.KEY_ESCAPE then + data.window:setShouldClose(true) + elseif data.key == glfw.KEY_SPACE then + entities:save("save") + elseif data.key == glfw.KEY_L then + entities:load("save") + end + end +end |