Thanks @Pkeod @Ragnar_Svensson and @britzl. There wasnt an issue with the listener, I just wasnt sure how to go about doing one, this helped me but I have a few questions.
self.score_levels = {250, 500}
What does this line mean? Why is the 500 there?
msg.post(listener, "score_reached", {score = score})
And is the listener on its own script, or is it placed in the script that takes care of passing and receiving score info?
local function incr_score(self, value) self.score = self.score + value local next_level = self.score_levels[1] while (next_level and next_level <= self.score) do notify(self, next_level) table.remove(self.score_levels, 1) next_level = self.score_levels[1] end end
trying to understand this part as well, kind of confused.Might I also suggest this be a good topic to cover in the tuts? I dont think I seen it there the other day when I was looking, unless I overlooked. it would be nice to have one that explains how to do this!
Thanks