//
//  GameScene.h
//  RedCore
//

#ifndef GameScene_h
#define GameScene_h

#include "cocos2d.h"

class GameScene : public cocos2d::Layer {
    public:
        static cocos2d::Scene* createScene(int level);
        virtual bool init();
        bool onContactBegin(cocos2d::PhysicsContact& contact);
        CREATE_FUNC(GameScene);
        void setLevel(int level);
        void alert(std::string text); // Mostra alerta
    private:
        void caseBallCollision (cocos2d::Node *ball);
        void caseBallCore (cocos2d::Node *core, cocos2d::Node *ball);
        void caseSaveLevel(Node *powerup_ball);
        void NextLevel(cocos2d::Ref *pSender);
        void saveLevel();
        void tripleBallsAppearance();
        void caseTripleBalls(Node *powerup_ball);
        void paddleBallAppearance();
        void casePaddleBall(Node *powerup_ball);
        void addAndThrowBall();
        int level;
        bool over; // salva se o jogo acabou!
        cocos2d::DrawNode * paddle;
        int paddle_size; // tamanho atual da raquete
        cocos2d::Node* balls; // Bolas
        double height, width; // tamanho do quadro
        int last_touch; // ultima vez que a bola colidiu com algo
};


#endif /* GameScene_h */
