// This is called whenever the `playersLayer` layer needs to be redrawn. // TODO: Can we get this called without the layer being cleared? void playersLayer_update_callback(Layer *me, GContext* ctx) { DemoGameState gameState; #ifdef INVERT_COLORS graphics_context_set_compositing_mode(ctx, GCompOpAssignInverted); #endif retrieveCurrentGameState(&gameState); drawGameState(ctx, gameState); }
void drawChopperDrop(ChopperDrop* game) { switch(game->currentState) { case MAIN_MENU_STATE: drawMainMenuState(game->state, game->date); break; case GAME_STATE: drawGameState(game->state, game->timer->counter); break; case GAME_OVER_STATE: drawGameOverState(game->state); break; case GAME_WON_STATE: drawGameWonState(game->state); break; default: break; } game->draw = 0; }