Pong clone in C with SDL/GL (code example).

Anything related in any way to game development as a whole is welcome here. Tell us about your game, grace us with your project, show us your new YouTube video, etc.

Moderator: PC Supremacists

Pong clone in C with SDL/GL (code example).

Postby lelandbdean on Thu Sep 17, 2015 12:33 pm

Hey guys.

Made a simple Pong clone for a thing. Thought it might help someone just starting out to understand SDL/OpenGL, basic game logic and program flow control, etc.
Be forewarned: Shit has one .c file, and is a bit ugly. It is the way it is on purpose.

Anyway, here's the repo:
https://github.com/lelandbdean/SDL-OpenGL-Pong

And here's a screenshot:
Image
lelandbdean
Chaos Rift Newbie
Chaos Rift Newbie
 
Posts: 19
Joined: Thu Mar 28, 2013 11:37 pm

Re: Pong clone in C with SDL/GL (code example).

Postby dandymcgee on Thu Sep 17, 2015 2:54 pm

Cool, thanks for sharing.

As you build on top of it and clean it up you should iteratively update the Git repo so that anyone using it to learn can go back and look at your history if they want. If you're trying to preserve the simplest possible project, you could fork it for the more complex version.
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
 
Posts: 4911
Joined: Tue Apr 29, 2008 4:24 pm
Location: New Hampshire

Re: Pong clone in C with SDL/GL (code example).

Postby lelandbdean on Thu Sep 17, 2015 3:57 pm

dandymcgee wrote:As you build on top of it and clean it up you should iteratively update the Git repo so that anyone using it to learn can go back and look at your history if they want. If you're trying to preserve the simplest possible project, you could fork it for the more complex version.


That's the plan, actually. :) Keep every iteration of the project available, so if someone wants they can step through the evolution. I know the project is really simple, but I think it's a valuable illustration.

When I was first getting started (as a clueless teenager) the lack of "finished" examples/usage code for most libraries was a hurdle. "Here's how to load an image" vs. "Here's how to link all these subsystems and APIs together to make something cohesive."

As you gain experience, you reach a point where basic examples (and Reading The Fucking Manual) is enough to make you comfortable, but as a programming virgin it's daunting to slog through documentation and trying to make sense of it with no frame of reference. Hopefully this will help someone past that.
lelandbdean
Chaos Rift Newbie
Chaos Rift Newbie
 
Posts: 19
Joined: Thu Mar 28, 2013 11:37 pm

Re: Pong clone in C with SDL/GL (code example).

Postby dandymcgee on Thu Sep 17, 2015 6:46 pm

lelandbdean wrote:As you gain experience, you reach a point where basic examples (and Reading The Fucking Manual) is enough to make you comfortable, but as a programming virgin it's daunting to slog through documentation and trying to make sense of it with no frame of reference. Hopefully this will help someone past that.

I owe everything I know about SDL to LazyFoo. Good times.
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
 
Posts: 4911
Joined: Tue Apr 29, 2008 4:24 pm
Location: New Hampshire

Re: Pong clone in C with SDL/GL (code example).

Postby superLED on Thu Oct 01, 2015 10:28 am

dandymcgee wrote:
lelandbdean wrote:As you gain experience, you reach a point where basic examples (and Reading The Fucking Manual) is enough to make you comfortable, but as a programming virgin it's daunting to slog through documentation and trying to make sense of it with no frame of reference. Hopefully this will help someone past that.

I owe everything I know about SDL to LazyFoo. Good times.

Haha, same here. I think I may have given up if it wasn't for his webpage with simple explanations of how tings work.
User avatar
superLED
Chaos Rift Junior
Chaos Rift Junior
 
Posts: 337
Joined: Sun Nov 21, 2010 12:56 pm
Location: Norway

Re: Pong clone in C with SDL/GL (code example).

Postby Falco Girgis on Mon Sep 19, 2016 7:48 am

Shit, I missed this thread. This is a really fucking badass take on pong, and I hope a lot of the newbies here realize how useful the source code is to them.
"So what happens if the Elysian Shadows Kickstarter fails?"
Image
User avatar
Falco Girgis
Elysian Shadows Team
Elysian Shadows Team
 
Posts: 10693
Joined: Thu May 20, 2004 3:04 pm
Location: Studio Vorbis, AL

Re: Pong clone in C with SDL/GL (code example).

Postby MarioWa on Sat Nov 18, 2017 7:43 am

This is really cool, thanks for the source code leland! Hope you don't mind if I play around with it!
MarioWa
Chaos Rift Newbie
Chaos Rift Newbie
 
Posts: 1
Joined: Wed Nov 15, 2017 7:10 am


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron