> which could lead to an update update draw
class Player
{
/* some code */
void update()
{
SomeEvent event;
/* some code */
eventManager.triggerEvent(&event, PLAYER_MOVED_MSG);
}
};
class SomeEnemy
{
/* some code */
void eventListener(void* data, int msgID)
{
if(msgID == PLAYER_MOVED_MSG)
{
SomeEvent eventData = static_cast<SomeEvent>(data);
/* react to the event */
}
}
};
void draw() { eventManager.triggerEvent(REDRAW) }
. It's the mix of logic and rendering that I am not sure I want to support in Gosu. It's too bad that you are not using Ruby or C++0x (I guess), otherwise you could have super-easy enqueuing with lambdas.> I'm not sure what REDRAW is doing?
const int REDRAW_MSG =…
.virtual void getHitBySilverBullet() { /* Vampire subclass can override this */
}).Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill