Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Ball.h
- *
- * Created on: Nov 21, 2014
- * Author: Austin
- *
- * Creates ball texture, when goes out of bounds, restarts back at center, launches in a random direction, collides with
- * bottom and top of window with the opposite direction of velocity.
- */
- #include <iostream>
- #include <SDL.h>
- using namespace std;
- #ifndef BALL_H_
- #define BALL_H_
- class Ball {
- private:
- SDL_Texture *texture;
- SDL_Rect posRect;
- int xVel, yVel;
- int GetRandomNumber(int high, int low);
- const int startX;
- const int startY;
- public:
- Ball(SDL_Renderer *renderBall, string filePath, int x, int y);
- ~Ball();
- int RandomNumber;
- void bDraw(SDL_Renderer *renderTarget);
- SDL_Rect ballRect;
- };
- #endif /* BALL_H_ */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement