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
|
|
|
|
{
|
2013-06-15 14:03:30 +08:00
|
|
|
CCPoint _velocity;
|
2012-04-19 14:35:52 +08:00
|
|
|
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:
|
2013-06-15 14:03:30 +08:00
|
|
|
void setVelocity(CCPoint velocity){_velocity = velocity;}
|
|
|
|
CCPoint getVelocity(){return _velocity;}
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
public:
|
|
|
|
static Ball* ballWithTexture(CCTexture2D* aTexture);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|