diff --git a/scripts/main.lua b/scripts/main.lua index 55423ca..eec4ae7 100644 --- a/scripts/main.lua +++ b/scripts/main.lua @@ -18,6 +18,7 @@ local princess local player local vitality +local online local key_states = {} local bullet_pool = {} @@ -85,6 +86,10 @@ function setup() vitality.font = fontfactory:get("playful") vitality:set("16+", 1350, 620) + online = overlay:create(WidgetType.label) + online.font = fontfactory:get("fixedsys") + online:set("Online 0", 1600, 15) + candle1 = entitymanager:spawn("candle") candle1.placement:set(60, 100) candle1.action:set("default") @@ -143,6 +148,9 @@ function setup() overlay:destroy(vitality) vitality = nil + overlay:destroy(online) + online = nil + scenemanager:set("gameover") collectgarbage("collect") @@ -204,6 +212,10 @@ function setup() table.insert(jet_pool, jet) end + io:on("online", function(data) + online:set("Online " .. data.clients) + end) + scenemanager:set("ship") end