[Resolved] Entity messaging

Hi,

How would you go about nodes messaging each other / posting and observing events?

In cocos2d-x I used the CCNotificationCenter for this purpose but there is no such thing in the HTML5 port. What is advisable to do? Use javascript’s built in event tools or port the notification center?

Thanks,
Felix

The CCNotification Center has not been ported in the Cocos2d-HTML5.

May be it will be added in next version.

Ok, so is this on some official to-do list? I would feel comfortable tackling and contributing this but if someone is already eyeing it, I don’t want to hold that person back.

Here is what I got - it seems to be working nicely but needs more testing (See file attached).

Good work!

We will check it. If it is right, I will merge it into repo.

Thanks a lot.

Congratulations!

Your file will be merged this morning.

Cool, but can I still make changes? I.e. one could make the selector either a string or an object, so one could pass in a anonymous function that is defined together with a call to cc.NotificationCenter.addObserver(…).