I am confused by the structure of my OpenGL (with GLUT) program. I am hoping to create a breakout-style game but have run into problems animating things. If someone could provide some guidance as to how I smoothly animate the paddle it''d be a great help.
So far the Paddle class looks like this:
enum PADDLES
{
flat,
convex,
concave
};
class Paddle
{
public:
//constructors
Paddle( );
Paddle( PADDLES );
~Paddle( );
//functions
void drawPaddle( );
void movePaddle( GLfloat movement );
//private:
PADDLES type;
Vector3d* currentLoc;
GLint width;
};
At present the paddle moves, but in noticable increments of 2 (the value passed to movePaddle() ). How should I go about making it move smoothly? Do I need a fine movement variable like Nehe used in tutorial 21? The renderScene function only calls the drawPaddle() function and movePaddle() is called in response to the key presses, is this correct?
Some advice would be greatly appreciated, I have been stuck for ages and its killing my love of programming