Jump to content
  • Advertisement
Sign in to follow this  
ZadrraS

[SDL] Anyone want to share a simple games source?

This topic is 5473 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I just want source code of a simple game, like pong, or tetris or anything else that isn't too complex and is written in SDL. It doesn't have to be finished or good looking. I want to see if i can improve my way of coding becouse it sucks, i use too much things that arent necesery (like loads of loops that slows down the game) and i almost don't use classes. Thank you. PS: If you can't upload it anywhere, email me, just post and ill give you my email.

Share this post


Link to post
Share on other sites
Advertisement
Thanks to both of you, rating++ a little. Tought Ekim_Gram's pong doesnt work, it asks for "MSCRV71.dll", but i don't need it to run, source code is enough. And most of the things linked in libsdl site are a little too fancy.
Keep the source code coming :)

Share this post


Link to post
Share on other sites
Also a few tips for ZadrraS.

1) cone3d.gamedev.net is where a majority of us learn how to use SDL. I highly suggest that you check it out and you download a copy of the SDL Documentation. It's the most clear and easy to understand doc you'll ever find for a graphics API.

2) Classes are a good way to keep your code orderly and neat. OOP allows you to create nice wrappers around code. Split your functions into classes and splits those classes into header|source files. Eventually, when you put most of the generic stuff into classes like such, you'll have your own little engine to work off of.

Share this post


Link to post
Share on other sites
I learned it a long time ago, ive already made a pong clone and now im working on a top down shooter game. I also made lots of small stuff with it.

EDIT:

Im asking this becouse im a little stuck with OOP and like ive said, i do lots of bad things that slows down my games.

Share this post


Link to post
Share on other sites
Check out This Game (Click) and This Game (click) and This Game (click) All of the Games are from the Cone 3D Site (click) and they are in increasing difficulty. The first two even have tutorials and explanations of the code associated with them. The games are not too complex, and should be pretty simple to understand. I believe you need SDL_ttf for all of them, and SDL_mixer for the latter two.

You might have a tough time getting simple examples OOP in SDL, with games like Pong or Tetris, just because those games are so easy to code for anyone with experience that they probably won't exactly set everything up in an OOP manner.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!