Guest User

Untitled

a guest
May 25th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. class JumpGameScene {
  2. ...
  3. public:
  4. void draw(Canvas *canvas) {
  5. canvas->clearScreen();
  6. // Similar to how each different game state has a different `update` logic,
  7. // Different Game stats have differnt things to draw.
  8. if (curGameState == GAME_START_SCREEN) {
  9. canvas->drawTexture(startGameBackground);
  10. }
  11. if (curGameState == IN_GAME) {
  12. for (int i=0; i < numGameObjects; i++) {
  13. gameObject[i]->draw(canvas);
  14. }
  15. canvas->drawText("SCORE %d", score);
  16. }
  17. if (curGameState == GAME_OVER) {
  18. canvas->drawTexture(endGameBackground);
  19. }
  20. }
  21. ...
  22. }
Add Comment
Please, Sign In to add comment