Register
handmade.network»Forums»Pong Clone -WIP- Need help reviewing code
Shazan Shums
169 posts

Some day I will make quality software.
Programming FTW.

Pong Clone -WIP- Need help reviewing code
3 years, 3 months ago

Hi,I have been following Handmade hero for a while and have
started working on a pong clone as starting point since I no experience
in game programming or general programming before watching Handmade hero.

I started the project after watching this.



I am currently using SDL2 and Opengl for the game.

I am currently curious as if I am programming in a bad way or writing
game code in a bad way or other problems.

Can someone review my code and explain me faults in my code and how to
fix them.

And is it normal a person to take 2 weeks to make this if it their first
time doing so.

And here the link to the
Pong Clone.

Just being curious on programming....
Yam
James Fulop
21 posts / 1 project

None

Pong Clone -WIP- Need help reviewing code
3 years, 3 months ago
Don't worry about how long it takes, two weeks seems reasonable to me, my first simple game took about the same amount of time I think.

Consider adding your library dependencies (SDL) to the repository, or providing a download link in the README to the exact version you are using, I was unable to compile because of that. Also your build script relies on ctime, so you may want to add that to the repo as well.

None
Shazan Shums
169 posts

Some day I will make quality software.
Programming FTW.

Pong Clone -WIP- Need help reviewing code
3 years, 3 months ago Edited by Shazan Shums on March 4, 2017, 6:30 a.m.
Oops sorry.. I didn't notice that and thanks for your interest.
The repo is updated with what you said check it out.
Also comment about it.

Just being curious on programming....
Timothy Wright
77 posts / 1 project
Pong Clone -WIP- Need help reviewing code
3 years, 3 months ago
This seems like a really good idea. Posting some code for a simple pong clone. I've seen engineers with 20 years experience write worse code than this, so I think it's fine.

There is no "right" way, only the way that makes you most efficient. Not just efficient code, but also easy to write, update, debug, and understand. It doesn't matter what it looks like if you are the only one who will ever see it.

Keep it up.
Shazan Shums
169 posts

Some day I will make quality software.
Programming FTW.

Pong Clone -WIP- Need help reviewing code
3 years, 3 months ago
Thanks i currently have an issue in wall collision it doesn't work around corners can't find seem to find bug.Help would be nice.

Just being curious on programming....
Simon Anciaux
795 posts
Pong Clone -WIP- Need help reviewing code
3 years, 3 months ago
Consider adding a test before calling vcvarsall.bat to avoid adding the same thing to the PATH several times. If you don't, after calling build.bat several times in the same console you'll get an error. Also, it will reduce the time it takes to execute build.bat (if you are running it several times and the environment is preserved).
1
2
3
4
IF NOT DEFINED vcvars_called (
    call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" %bits%
    set vcvars_called=1
)