I’m going off of the Mini Game Party in order to try doing something similar to Warioware. However I’d like make it so that the program loads the minigames before hand, then loads them one at a time, because when debugging, each of the minigames are loading right after one another. Another problem is it’s actually not loading anything, and there’s no message giving me errors.
local MINIGAMES = {
{ proxy = "#insert_book_code_proxy", script = "insert_book_code:/game#script" } ,
{ proxy = "#shelving_proxy", script = "shelving:/game#script" },
{ proxy = "#where_to_find_book_proxy", script = "where_to_find_book:/game#script" }
}
local score = 0
local function shuffle(t)
for n=1,#t do
local k = math.random(#t)
t[n], t[k] = t[k], t[n]
end
return t
end
local function minigame_load()
MINIGAMES = shuffle(MINIGAMES)
for _, minigame in ipairs(MINIGAMES) do
msg.post(minigame.proxy, "load")
end
end
function init(self)
minigame_load()
end
-- nested function for loading and unloading?
function on_message(self, message_id, message, sender)
if message_id == hash("game_over") then
msg.post(minigame.proxy, "unload")
minigame_load()
end
end
Also I’ve probably have to store minigame.proxy in a variable due to scope. Thanks in advance.