2012-04-19 14:35:52 +08:00
|
|
|
#ifndef _PADDLE_H_
|
|
|
|
#define _PADDLE_H_
|
|
|
|
|
|
|
|
#include "cocos2d.h"
|
|
|
|
|
2012-06-14 05:19:13 +08:00
|
|
|
USING_NS_CC;
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
typedef enum tagPaddleState
|
|
|
|
{
|
|
|
|
kPaddleStateGrabbed,
|
|
|
|
kPaddleStateUngrabbed
|
|
|
|
} PaddleState;
|
|
|
|
|
|
|
|
class Paddle : public CCSprite, public CCTargetedTouchDelegate
|
|
|
|
{
|
2013-06-15 14:03:30 +08:00
|
|
|
PaddleState _state;
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
public:
|
|
|
|
Paddle(void);
|
|
|
|
virtual ~Paddle(void);
|
|
|
|
|
|
|
|
CCRect rect();
|
|
|
|
bool initWithTexture(CCTexture2D* aTexture);
|
|
|
|
virtual void onEnter();
|
|
|
|
virtual void onExit();
|
|
|
|
bool containsTouchLocation(CCTouch* touch);
|
|
|
|
virtual bool ccTouchBegan(CCTouch* touch, CCEvent* event);
|
|
|
|
virtual void ccTouchMoved(CCTouch* touch, CCEvent* event);
|
|
|
|
virtual void ccTouchEnded(CCTouch* touch, CCEvent* event);
|
|
|
|
virtual CCObject* copyWithZone(CCZone *pZone);
|
|
|
|
|
|
|
|
virtual void touchDelegateRetain();
|
|
|
|
virtual void touchDelegateRelease();
|
|
|
|
|
|
|
|
static Paddle* paddleWithTexture(CCTexture2D* aTexture);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|