axmol/test_uphone/tests/TouchesTest/Ball.h

33 lines
588 B
C
Raw Normal View History

2010-08-27 11:53:35 +08:00
#ifndef _BALL_H_
#define _BALL_H_
#include "cocos2d.h"
class Paddle;
using namespace cocos2d;
class Ball : public CCSprite
{
CGPoint m_velocity;
public:
Ball(void);
virtual ~Ball(void);
float radius();
//BOOL initWithTexture(CCTexture2D* aTexture);
//virtual void setTexture(CCTexture2D* newTexture);
void move(ccTime delta);
void collideWithPaddle(Paddle* paddle);
public:
void setVelocity(CGPoint velocity){m_velocity = velocity;}
CGPoint getVelocity(){return m_velocity;}
public:
static Ball* ballWithTexture(CCTexture2D* aTexture);
};
#endif