GameScene.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. //
  2. // GameScene.h
  3. // RedCore2
  4. //
  5. // Created by Gabriel Capella on 31/05/17.
  6. //
  7. //
  8. #ifndef GameScene_h
  9. #define GameScene_h
  10. #include "cocos2d.h"
  11. #include "GameScene/Paddle.h"
  12. class GameScene : public cocos2d::Layer {
  13. public:
  14. static cocos2d::Scene* createScene(int level);
  15. virtual bool init();
  16. bool onContactBegin(cocos2d::PhysicsContact& contact);
  17. CREATE_FUNC(GameScene);
  18. void setLevel(int level);
  19. void alert(std::string text); // Mostra alerta
  20. private:
  21. void caseBallCollision (cocos2d::Node *ball);
  22. void caseBallCore (cocos2d::Node *core, cocos2d::Node *ball);
  23. void caseSaveLevel(Node *powerup_ball);
  24. void NextLevel(cocos2d::Ref *pSender);
  25. void saveLevel();
  26. void tripleBallsAppearance();
  27. void caseTripleBalls(Node *powerup_ball);
  28. void paddleBallAppearance();
  29. void caseRaqueteBall(Node *powerup_ball);
  30. void superBallAppearance();
  31. void caseSuperBall(Node *powerup_ball);
  32. void addAndThrowBall();
  33. int level;
  34. bool over; // salva se o jogo acabou!
  35. Paddle * paddle;
  36. cocos2d::Node* balls; // Bolas
  37. double height, width; // tamanho do quadro
  38. unsigned long int last_touch; // ultima vez que a bola colidiu com algo
  39. };
  40. #endif /* GameScene_h */