/******************************************************************** File: ball.h Author: Dana Vrajitoru Project: A simple 2D animation program based on the Breakout game. Last updated: February 3, 2011. A class handling a 2D circle moving on the screen. ********************************************************************/ #ifndef BALL_H #define BALL_H class Ball { public: // The ball's position float x, y; // How big the ball is float radius; // Velocity over x and y float vx, vy; // Color of the ball float r, g, b; // Bounding box float bwidth, bheight; GLUquadric *disk; // default constructor with given Ball(float rad = 1.0); // Define the boundaries for the window void set_box(float bw, float bh); // Set the color of the object void set_color(float valr, float valg, float valb); // Change its coordinates void move_to(float posx, float posy); // Initialize the speed to some values. void set_speed(float tx, float ty); // Reset the value of the speed with random values between 0 and the limit. void randomize_speed(float limit); // Move the ball from the current position based on its velocity void move(); // Draw the ball at given coordinates void draw(); }; #endif