2010-08-27 11:53:35 +08:00
|
|
|
#ifndef _BALL_H_
|
|
|
|
#define _BALL_H_
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
#include "cocos2d.h"
|
|
|
|
|
|
|
|
class Paddle;
|
|
|
|
|
2012-06-14 05:19:13 +08:00
|
|
|
USING_NS_CC;
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
class Ball : public CCSprite
|
|
|
|
{
|
|
|
|
CCPoint m_velocity;
|
|
|
|
public:
|
|
|
|
Ball(void);
|
|
|
|
virtual ~Ball(void);
|
|
|
|
|
|
|
|
float radius();
|
|
|
|
//BOOL initWithTexture(CCTexture2D* aTexture);
|
|
|
|
//virtual void setTexture(CCTexture2D* newTexture);
|
2012-06-12 01:43:07 +08:00
|
|
|
void move(float delta);
|
2012-04-19 14:35:52 +08:00
|
|
|
void collideWithPaddle(Paddle* paddle);
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
void setVelocity(CCPoint velocity){m_velocity = velocity;}
|
|
|
|
CCPoint getVelocity(){return m_velocity;}
|
|
|
|
|
|
|
|
public:
|
|
|
|
static Ball* ballWithTexture(CCTexture2D* aTexture);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|