endo
04-11-2002, 02:54 AM
My breakout game now has a moving paddle and I have been thinking about how to implement the collision detection. After looking at the tutorials on gametutorial.com I came across an easyish approach.
However now I need to define the polygons for the paddle in the class. I have 3 types of paddle in my game, so does this mean declaring all the points for all the different paddles as data members? Or is there a better way?
My class so far looks like this:
class Paddle
{
public:
//constructors
Paddle( );
Paddle( PADDLES );
~Paddle( );
//functions
void drawPaddle( );
void movePaddle( GLfloat movement, DIRECTION dir );
//private:
PADDLES type;
DIRECTION direction;
GLfloat move;
Vector3d* currentLoc;
GLint width;
//do I add all the points for all the paddles in here?
};
I am sure a similar problem will preent itself when I implement the blocks as well, so I'd like to clear it up now http://www.opengl.org/discussion_boards/ubb/smile.gif
However now I need to define the polygons for the paddle in the class. I have 3 types of paddle in my game, so does this mean declaring all the points for all the different paddles as data members? Or is there a better way?
My class so far looks like this:
class Paddle
{
public:
//constructors
Paddle( );
Paddle( PADDLES );
~Paddle( );
//functions
void drawPaddle( );
void movePaddle( GLfloat movement, DIRECTION dir );
//private:
PADDLES type;
DIRECTION direction;
GLfloat move;
Vector3d* currentLoc;
GLint width;
//do I add all the points for all the paddles in here?
};
I am sure a similar problem will preent itself when I implement the blocks as well, so I'd like to clear it up now http://www.opengl.org/discussion_boards/ubb/smile.gif