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;
|
|
|
|
|
2013-09-03 18:22:03 +08:00
|
|
|
class Paddle : public Sprite, public 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);
|
|
|
|
|
2013-07-08 23:05:47 +08:00
|
|
|
Rect getRect();
|
2013-06-20 14:17:10 +08:00
|
|
|
bool initWithTexture(Texture2D* aTexture);
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual void onExit() override;
|
2013-06-20 14:17:10 +08:00
|
|
|
bool containsTouchLocation(Touch* touch);
|
2013-09-03 18:22:03 +08:00
|
|
|
bool onTouchBegan(Touch* touch, Event* event);
|
|
|
|
void onTouchMoved(Touch* touch, Event* event);
|
|
|
|
void onTouchEnded(Touch* touch, Event* event);
|
2013-07-08 23:05:47 +08:00
|
|
|
virtual Paddle* clone() const;
|
2012-04-19 14:35:52 +08:00
|
|
|
|
2013-07-08 23:05:47 +08:00
|
|
|
static Paddle* createWithTexture(Texture2D* aTexture);
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|