Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class JumpGameScene {
- ...
- public:
- void draw(Canvas *canvas) {
- canvas->clearScreen();
- // Similar to how each different game state has a different `update` logic,
- // Different Game stats have differnt things to draw.
- if (curGameState == GAME_START_SCREEN) {
- canvas->drawTexture(startGameBackground);
- }
- if (curGameState == IN_GAME) {
- for (int i=0; i < numGameObjects; i++) {
- gameObject[i]->draw(canvas);
- }
- canvas->drawText("SCORE %d", score);
- }
- if (curGameState == GAME_OVER) {
- canvas->drawTexture(endGameBackground);
- }
- }
- ...
- }
Add Comment
Please, Sign In to add comment