thecplusplusguy

Simple pong game (SDL) - README

Jul 4th, 2011
1,331
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. IMPORTANT TO READ THIS!
  2.  
  3. The SDL version of the pong game can be compiled (almost) any platform, to compile it, you have to setup the SDL, SDL_TTF and the SDL_mixer:
  4. http://www.libsdl.org/download-1.2.php
  5. http://www.libsdl.org/projects/SDL_ttf/
  6. http://www.libsdl.org/projects/SDL_mixer/
  7. Download them extract them, and in your IDE (for example Code::Blocks) add the include folder at the compile section and the libs to the linker settings (as I showed you in the 0. tutorial), you have to use the following flags (in case of Windows):
  8. -lmingw32 -lSDL_main -lSDL_ttf -lSDL_mixer -lSDL
  9.  
  10. In Linux, install the libraries like this:
  11. sudo apt-get install libsdl1.2-dev libsdl-ttf2.0-dev libsdl-mixer1.2-dev
  12.  
  13. And compile the program like this:
  14. g++ main.cpp ball.cpp paddle.cpp -o pong -lSDL -lSDL_ttf -lSDL_mixer
  15.  
  16. IMPORTANT:
  17. Beside the runnable (binary) file you have to put a 10x50 bmp called paddle.bmp (the paddle) a 20x20 bmp called ball.bmp (the ball) a ttf called air.ttf, a wav called Hackbeat.wav and a bassdrum1.wav (obviusly you can change the names or the parameters of the files if you want, in the code)
  18.  
  19.  
  20. I admit, the design of the program not the best, but it does what I planned. You may want to rewrite the program and make the main file content to a class, so it could be easier to see it through.
  21.  
  22. http://www.youtube.com/user/thecplusplusguy
Advertisement
Add Comment
Please, Sign In to add comment