2012-04-19 14:35:52 +08:00
|
|
|
#ifndef _PADDLE_H_
|
|
|
|
#define _PADDLE_H_
|
|
|
|
|
|
|
|
#include "cocos2d.h"
|
|
|
|
|
|
|
|
|
|
|
|
typedef enum tagPaddleState
|
|
|
|
{
|
|
|
|
kPaddleStateGrabbed,
|
|
|
|
kPaddleStateUngrabbed
|
|
|
|
} PaddleState;
|
|
|
|
|
2015-04-09 08:37:30 +08:00
|
|
|
class Paddle : public cocos2d::Sprite, public cocos2d::Clonable
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2013-06-15 14:03:30 +08:00
|
|
|
PaddleState _state;
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
public:
|
|
|
|
Paddle(void);
|
|
|
|
virtual ~Paddle(void);
|
|
|
|
|
2015-04-09 08:37:30 +08:00
|
|
|
cocos2d::Rect getRect();
|
|
|
|
bool initWithTexture(cocos2d::Texture2D* aTexture) override;
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual void onExit() override;
|
2015-04-09 08:37:30 +08:00
|
|
|
bool containsTouchLocation(cocos2d::Touch* touch);
|
|
|
|
bool onTouchBegan(cocos2d::Touch* touch, cocos2d::Event* event);
|
|
|
|
void onTouchMoved(cocos2d::Touch* touch, cocos2d::Event* event);
|
|
|
|
void onTouchEnded(cocos2d::Touch* touch, cocos2d::Event* event);
|
2015-03-15 07:10:08 +08:00
|
|
|
virtual Paddle* clone() const override;
|
2012-04-19 14:35:52 +08:00
|
|
|
|
2015-04-09 08:37:30 +08:00
|
|
|
static Paddle* createWithTexture(cocos2d::Texture2D* aTexture);
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|