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

Some day I will make quality software.
Programming FTW.

#11145 Pong Clone -WIP- Need help reviewing code
2 weeks, 5 days 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
8 posts
1 project

None

#11151 Pong Clone -WIP- Need help reviewing code
2 weeks, 5 days 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
msmshazan
Shazan Shums
92 posts

Some day I will make quality software.
Programming FTW.

#11162 Pong Clone -WIP- Need help reviewing code
2 weeks, 4 days 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
Timothy Wright
48 posts
1 project
I spent my 20s as an Army piano player (jazz and rock), ...
#11164 Pong Clone -WIP- Need help reviewing code
2 weeks, 4 days 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.
msmshazan
Shazan Shums
92 posts

Some day I will make quality software.
Programming FTW.

#11167 Pong Clone -WIP- Need help reviewing code
2 weeks, 3 days 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....
mrmixer
Simon Anciaux
172 posts
#11173 Pong Clone -WIP- Need help reviewing code
2 weeks, 3 days 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
)