In Gideros, I have am making use of a custom event to update the score. I have the following code for the receiver of the event (some lines left out for brevity):
GameInfoPanel = Core.class(Sprite)
function GameInfoPanel:init()
self:addEventListener("add_score", self.onAddScore, self) -- Registering event listener here
self.score = 0
end
function GameInfoPanel:onAddScore(event)
self.score = self.score + event.score -- << This line is never reached
end
And this is the code that triggers the event:
local score_event = Event.new("add_score")
score_event.score = 100
self:dispatchEvent(score_event)
However, the function registered as the listener above is never reached.