hi everyone!
im thinking about creating a game too.
my question is related to this suggestion by cliff:
...
So, each sprite mediator, upon hearing the TIMER_TICK notification sent by the TimeProxy, advances its sprite and then sends a SPRITE_MOVED notification, with the sprite in question as the body.
All interested sprite mediators, handle the SPRITE_MOVED notification by doing a hitTest call on their sprite to see if there is a collision. ( (mySpriteInstance.hitTest(notification.getBody() as MySprite) )
...
i would have thought that the sprite mediators hear the TIMER_TICK notification, move the sprite, and then modify the model/proxy that is storing the position of the sprite. the proxy sends the notification SPRITE_MOVED, and then the mediators check for a hit?
how do you guys decide when to use a proxy and when to handle things in a mediator (i would do latter when needing a pure animation, that doesnt influence a proxy )
another question:
...
Then its a rock / paper scissors game. If its a tank who's just heard that an anti-tank missile has collided with it, then the TankMediator instance will remove the event listeners from its view component, set the viewComponent property to null, and then call facade.removeMediator(this.getMediatorName()), freeing up the memory from the tank sprite and its mediator for the GC.
...
when there are many instances of a mediator, wouldnt this.getMediatorName fail??
thanks for reading,
tehk