Just when i think i’m close… lol… Seem to be getting this error message on the main menu script: any clues?
Compilation failed: function arguments expected near '…'
function on_message(self, message_id, message, sender)
if message_id == hash(“update_score”) then
-- set the score counter to new score
local score_node = gui.get_node(“score”)
gui.set_text(score_node, “SCORE: “.. message.score)
end
end
function on_input(self, action_id, action)
if(action_id == hash("click") and action.released == true) then
local textBegin = gui.get_node("textBeginGame")
if(gui.pick_node(textBegin,action.x,action.y)) then
msg.post("loader:/go#loader", "start_game")
end
end
if(action_id == hash("click") and action.released == true) then
local textExit = gui.get_node("textExitGame")
if(gui.pick_node(textExit,action.x,action.y)) then
msg.post("@system:", "exit", {code = 0})
end
end
end
and this error message on the loader script:
Compilation failed: ‘)’ expected near the ‘#’
function save_gamedata(self)
-- reset player score
shared_data.player.score = 0
-- save gamedata
if not sys.save("save.txt", shared_data) then
print("Gamedata not saved")
end
end
function init(self)
msg.post(".", "acquire_input_focus")
load_gamedata(self)
load_menu(self)
end
function on_message(self, message_id, message, sender)
if message_id == hash("start_game") then
unload_menu(self)
load_main(self)
end
if message_id == hash(“game_over”) then
unload_main(self)
load_menu(self)
save_gamedata(self)
msg.post(“/mainmenu#gui”, “update_score”, { score = gamedata.player.highscore }
elseif...
end
end
end