Skip to content

Commit 3076e61

Browse files
committed
Work in progress
1 parent 057e45f commit 3076e61

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

scripts/main.lua

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ local princess
1818
local player
1919

2020
local vitality
21+
local online
2122

2223
local key_states = {}
2324
local bullet_pool = {}
@@ -85,6 +86,10 @@ function setup()
8586
vitality.font = fontfactory:get("playful")
8687
vitality:set("16+", 1350, 620)
8788

89+
online = overlay:create(WidgetType.label)
90+
online.font = fontfactory:get("fixedsys")
91+
online:set("Online 0", 1600, 15)
92+
8893
candle1 = entitymanager:spawn("candle")
8994
candle1.placement:set(60, 100)
9095
candle1.action:set("default")
@@ -143,6 +148,9 @@ function setup()
143148
overlay:destroy(vitality)
144149
vitality = nil
145150

151+
overlay:destroy(online)
152+
online = nil
153+
146154
scenemanager:set("gameover")
147155

148156
collectgarbage("collect")
@@ -204,6 +212,10 @@ function setup()
204212
table.insert(jet_pool, jet)
205213
end
206214

215+
io:on("online", function(data)
216+
online:set("Online " .. data.clients)
217+
end)
218+
207219
scenemanager:set("ship")
208220
end
209221

0 commit comments

Comments
 (0)