Most upvoted comment
Top rated programming books on Reddit rank no. 17
Learn to make a 2D Game in C++!(r/learnprogramming)
Hey! This is a really cool project idea, especially for a tutorial, but there are some things in the code that concern me.
Before I go any further, a disclaimer: You are not your code.
I work in the industry at a very big studio as a gameplay programmer, and there are a couple parts of this code that I saw right when opening the github that made me want to comment about code quality.
In Animated Sprite – you take in a file path and load an image directly from disk. This, on a large scale, will cause problems at load time. It could be ameliorated by doing all asset loading up front and maintaining a manager to dole out references to them in memory instead of from disk. Secondly, Enemy inherits from Animated Sprite. This breaks a few rules, specifically the IS-A relationship in inheritance (also covariant problems. This is why the industry as a whole favors composition over inheritance. An enemy that is renderable might have a sprite to render with, but it wouldn’t BE a sprite.
There are other criticisms, but I’ll stop here. What I wanted to say was – Caveat Emptor. This is a fun project to learn what goes into a game, and no one here should quit based on these criticisms, especially if it inspires your passion. Rather, use this as an avenue to learn good software practices that can actually land you a gig in the industry.
Sorry if this came across offensive, but since this is r/learnprogramming, I figured it was a good chance to learn.
EDIT: Formatting EDIT: GOLD?!
Permalink : /r/learnprogramming/comments/3x7sqb/learn_to_make_a_2d_game_in_c/