axmol/samples/Cpp/TestCpp/Classes/TouchesTest/Ball.h

33 lines
569 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_NS_CC;
class Ball : public Sprite
{
Point _velocity;
public:
Ball(void);
virtual ~Ball(void);
float radius();
//BOOL initWithTexture(Texture2D* aTexture);
//virtual void setTexture(Texture2D* newTexture);
2012-06-12 01:43:07 +08:00
void move(float delta);
void collideWithPaddle(Paddle* paddle);
public:
void setVelocity(Point velocity){_velocity = velocity;}
Point getVelocity(){return _velocity;}
public:
static Ball* ballWithTexture(Texture2D* aTexture);
};
#endif