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.
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.
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.
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
)