-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.lua
More file actions
31 lines (25 loc) · 723 Bytes
/
Copy pathmain.lua
File metadata and controls
31 lines (25 loc) · 723 Bytes
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
function load()
font = love.graphics.newFont(love.default_font)
love.graphics.setFont(font)
center = {}
center.x = love.graphics.getWidth()/2
center.y = love.graphics.getHeight()/2
fontd = {}
fontd.width = font:getWidth("0")
fontd.height = font:getHeight()
end
function update()
end
function keypressed(key)
if key == love.key_s then
love.filesystem.include("snake_serv.lua")
elseif key == love.key_c then
love.filesystem.include("snake_clnt.lua")
end
end
function draw()
text = "S to start server"
love.graphics.draw(text, center.x - fontd.width*#text/2, center.y - fontd.height/2)
text = "C to start client"
love.graphics.draw(text, center.x - fontd.width*#text/2, center.y + fontd.height/2)
end