// CPaddle implementation // // Author: Josh Jenkins // Inertia Productions 2003 // http://homepages.ihug.com.au/~grom #include "CPaddle.h" // Class declaration //////////////////////////////////////////////////////////////////// // Constructor CPaddle::CPaddle(): x(0.0f), y(0.0f), width(0.5f), height(3.0f), speed(0.3f), score(0) { color[0] = 0; color[1] = 1; color[2] = 0; } //////////////////////////////////////////////////////////////////// // Destructor CPaddle::~CPaddle() { } //////////////////////////////////////////////////////////////////// // Draw to opengl screen CPaddle::Draw() { glColor3fv(color); glBegin(GL_QUADS); glVertex3f(x, y , 0.0f); glVertex3f(x, y - height, 0.0f); glVertex3f(x + width, y - height, 0.0f); glVertex3f(x + width, y , 0.0f); glEnd(); } //////////////////////////////////////////////////////////////////// // Reset paddle for new game CPaddle::Reset() { score = 0; }