– show the collection once loaded into memory
if message_id == hash(“proxy_loaded”) then
msg.post(sender, “enable”)
– load the correct collection when a message is received
elseif message_id == hash(“show_firstMenu_screen”) then
– first menu screen
msg.post(self.current_collection, “unload”)
msg.post("/controller#firstMenu_proxy", “load”)
self.current_collection = “/controller#firstMenu_proxy”
elseif message_id == hash(“show_logIn_screen”) then
– log in screen
msg.post(self.current_collection, “unload”)
msg.post("/controller#logIn_proxy", “load”)
self.current_collection = “/controller#logIn_proxy”
elseif message_id == hash(“show_signUp_screen”) then
– sign up screen
msg.post(self.current_collection, “unload”)
msg.post("/controller#signUp_proxy", “load”)
self.current_collection = “/controller#signUp_proxy”
elseif message_id == hash(“show_mainMenu_screen”) then
msg.post(self.current_collection, “unload”)
msg.post("/controller#mainMenu_proxy", “load”)
self.current_collection = “/controller#mainMenu_proxy”
elseif message_id == hash(“show_levelSelection_screen”) then
msg.post(self.current_collection, “unload”)
msg.post("/controller#levelSelection_proxy", “load”)
self.current_collection = “/controller#levelSelection_proxy”
elseif message_id == hash(“show_settings_screen”) then
msg.post(self.current_collection, “unload”)
msg.post("/controller#settings_proxy", “load”)
self.current_collection = “/controller#settings_proxy”
elseif message_id == hash(“show_customisation_screen”) then
msg.post(self.current_collection, “unload”)
msg.post("/controller#customisation_proxy", “load”)
self.current_collection = “/controller#customisation_proxy”
elseif message_id == hash(“closeGame”) then
os.exit()
end
end```