-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.lua
More file actions
57 lines (45 loc) · 1.11 KB
/
main.lua
File metadata and controls
57 lines (45 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
if os.getenv("LOCAL_LUA_DEBUGGER_VSCODE") == "1" then
require("lldebugger").start()
end
local Fspace = require("fspace")
local fspace
local Menu = require("menu")
local menu
local SceneryInit = require("scenery/scenery")
local scenery = SceneryInit(
{
path = "menu";
key = "menu";
default = true;
},
{
path = "fspace";
key = "fspace";
}
)
function love.load()
love.window.setMode(1, 2)
love.window.setMode(800, 800, {resizable=true, vsync=1, minwidth=200, minheight=300})
love.window.setTitle("fspace")
scenery:load()
print("Welcome to fspace!")
end
function love.update(dt)
scenery:update(dt)
end
function love.draw()
scenery:draw()
end
function love.keypressed(key)
scenery:keypressed(key)
if key == "tab" then
local state = not love.mouse.isGrabbed() -- the opposite of whatever it currently is
love.mouse.setGrabbed(state)
end
end
function love.mousemoved(x, y, dx, dy, istouch)
scenery:mousemoved(x, y, dx, dy, istouch)
end
function love.mousepressed(x, y, dx, dy, istouch)
scenery:mousepressed(x, y, dx, dy, istouch)
end