/******************************************************************** File: Paddle.h Author: Dana Vrajitoru Project: A simple 2D animation program based on the Breakout game. Last updated: February 6, 2017. A class handling the paddle that catches the ball. ********************************************************************/ #ifndef PADDLE_H #define PADDLE_H #include "Ball.h" class Paddle { public: // The paddle's position, lower left corner float x, y; // How big the paddle is float width, height; // Color of the paddle float r, g, b; // Bounding box - still need these to avoid moving out of the window float bwidth, bheight; // default constructor with given Paddle(float w=4, float h=1); // Define the boundaries for the window void setBox(float bw, float bh); // Set the color of the object void setColor(float valr, float valg, float valb); // Change its coordinates void jumpTo(float posx, float posy); // Move the paddle left and right. If the paddle goes out of the // window, don't move. These should be called from the arrow keys. void moveLeft(float tx); void moveRight(float tx); // Draw the paddle at given coordinates void draw(); // Function to figure out if the paddle and the ball intersect bool intersect(Ball &b); }; #endif