GameScene.h 1.2 KB

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