1
0

GameScene.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. void removeBallsAndPowersUP();
  34. void createPowerUpBody(cocos2d::Color4B color, int tag);
  35. void delayCallback(const std::function<void ()> &func);
  36. int level;
  37. bool over; // salva se o jogo acabou!
  38. Paddle * paddle;
  39. cocos2d::Node* balls; // Bolas
  40. cocos2d::Node* power_ups; // Bolas
  41. double height, width; // tamanho do quadro
  42. unsigned long int last_touch; // ultima vez que a bola colidiu com algo
  43. };
  44. #endif /* GameScene_h */