Code: Select all
typedef struct {
int type, sender, receivers, data ;
}event;
The Root Node has an Index of 0,
All node that need to receive "system" events (key press, key release, mouse moe, etc...) have negative indices. all others - positive...
A Key press triggers the Scene Manager's sendEvent() method, which sends an event to all 'negative' nodes ( getEvent(event) ), they then decide what to do. Now, while this is effective for sending events to many nodes from the outside of the scene manager, it is almost impossible to send specific events to seperate nodes, especially from the update() procedure of a node, like a collision event...
My questions to you:
1. What do you think of this system?
2. How can I make it be capable of easily sending specific events from one node to another?
![Rolling Eyes :roll:](./images/smilies/icon_rolleyes.gif)