thecplusplusguy

Simple pong game (SDL) - ball.h

Jul 4th, 2011
2,064
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.55 KB | None | 0 0
  1. //Simple pong game - ball.h
  2. //created by thecplusplusguy
  3. //     http://www.youtube.com/user/thecplusplusguy
  4. #include <SDL/SDL.h>
  5. #include <SDL/SDL_mixer.h>
  6. #ifndef BALL_H
  7. #define BALL_H
  8.  
  9. class ball{
  10.     int xvel,yvel;
  11.     SDL_Surface* image;
  12.     SDL_Rect box;
  13.     bool collision(SDL_Rect* rec1,SDL_Rect* rec2);
  14.     public:
  15.     ball(SDL_Surface* img,int x,int y,int w,int h,int xVel,int yVel);
  16.     ~ball();
  17.     void show();
  18.     void move(SDL_Rect* player1,SDL_Rect* player2,Mix_Chunk*);
  19.     int isOut();
  20.     void setBack(int x,int y,int w,int h,int xVel,int yVel);
  21. };
  22.  
  23.  
  24. #endif
Advertisement
Add Comment
Please, Sign In to add comment