Jump to content
  • Advertisement
Sign in to follow this  

// Finished Game Project For Beginners!

This topic is 3036 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

// Finished Game Project For Beginners!


If your a beginner game programmer this may be a good place to start.
I am offering to you a FREE Open-Source Cross-Platform finished game!

Game builds and runs on Windows®/Linux/Mac® OS X®...
Technology used is:
- SDL 1.2
- SDL_image
- SDL_mixer
- SDL_ttf
- OpenGL®


JeZ+Lee's GTR Twin Turbo 2-D Game Engine Features:
- Cross-Platform (tested on Windows®/Linux/Mac® OS X®)
- Resizable window creation
- Platform independent frame lock
- OpenGL® hardware accelerated drawing
- PNG image rotation, scaling, transparency, and hue change
- TTF fonts (with justification:left/center/right/center on point)
- Fade from black/fade to black screen transitions
- Frames Per Second(FPS) display to test performance(press [d] on 1st screen)
- 16 channel digital WAV sound effects
- 16bit digital OGG music playback
- Input from keyboard and mouse
- GUI button engine
- Loaded/saved options and high scores
- Source written in C++ using a class based system
- Plus much more!

Title Screen Title Screen


Video Game Design Studio

[Edited by - JeZ-l-Lee on July 20, 2010 7:37:44 AM]

Share this post

Link to post
Share on other sites
Original post by Steve25
Looks great I'll have a look at it in a little while. Thanks
Hi Steve25,

How did you make out?


Share this post

Link to post
Share on other sites
Original post by JeZ-l-Lee
Over 3,100+ downloads of LettersFall 2 source and no comments?
Very rude!

Maybe you should consider two things:
1) The amount of source code is quite big, so beginners might be overwhelmed
by the sheer amount of code you throw at them.
2) Your source, even though well-structured, lacks comments so it's very hard to follow for the intended audience.

So bottom line: nice try, but you cannot expect to just throw beginners a bone and expect any feedback other than a perplexed face [smile].

First and foremost some positive feedback:

You finished a game [smile].
Your game seems polished (though I have to admit I didn't play it [smile]).
You made the source code public, which is very honourable.
The game is cross-platform and makes use of libraries wherever possible, which
is a Good Thing™,.

On with the critique (you asked for it [wink]).
After just skimming through some of the files, the following sprung to mind.
(I will provide file names and line numbers for reference in the form of [file name:line number<,line number>])

0) Oh documentation, where art thou?
- No architecture overview, no code structure description, no source
code documentation, no nothing.
Not even a hint on how to compile the thing (keep in mind - your intended
target audience is beginners!). Some IDE projects for each platform would
have been a huge plus (remember: beginners).

1) Use of archaic syntax.
- Don't decorate constructors, destructors and parameterless functions with
a (void) parameter. That is unnecessary and considered bad style.

2) Unnecessary use of #define statements
- Preprocessor statements are not typesafe so use constants or enumerations

3) Lack of encapsulation - everything is public?!

3) Using "C with classes" instead of C++.
- You fail to use any of the C++ STL goodness and dangerously fiddle with C
char-arrays all the time instead of just using std::string.
- No STL containers to be seen - instead, again with the unsafe arrays and
hardcoded size limits on them. Bad C++ programmer, no cookie for you! [smile].
[everywhere in your code]

4) At times, your code is very obscure and hard to follow.
- Example: [buttons.cpp:258ff] "for (int index = 7; index < 9; index++)"
Seriously? WTF? Neither the name of the method ("DrawButtonSelector"), nor
the (non-existent) comments provide any indication of what the heck is going
on there.

5) Globals. Globals? Globals!
- Whenever you use "extern Foo* foo;" in C++, the man in the sky kills a puppy.
Please, think of the puppies!
But seriously, why on earth would you use global variables if you could just
pass them as parameters to the classes that need access to them?

5) Magic numbers. I like magic. But I also like readable code.
- You code is riddled with magic numbers that are not only undocumented (hint: a sensibly named constant counts as documentation, too), but also decorated with
strange, almost mystical "hints":

Score = 0;//1234;
Level = 0;//13;

Oh yeah, that clears things up a lot [smile]

visuals->Sprites[105].AnimationTimer = -1;

Makes perfect sense. Wait! No, it doesn't [sad]
Also, [lettersFall.cpp:169ff]

Playfield[0][16] = 10;
Playfield[1][13] = 15;
Playfield[2][14] = 25;
Playfield[3][16] = 6;
Playfield[4][13] = 21;
Playfield[5][16] = 12;
Playfield[6][14] = 12;
Playfield[7][15] = 25;

Cute, but meaningless to anyone (including you ten months from now).

6) Class names do not match responsibilities.
- Game.h/Game.cpp: I'd imagine finding the, well, game code here
(including the main loop, state transitions and the like), but noooo...
It serves no purpose other than calculating the framerate (wth?) and
holding a single(!!!!) game-related flag - namely "ExitGame". [Game.h:9]
Even a seasoned (ex-professional game-) programmer like me gets a little
confused by that [smile]

Thank you for your sharing your great work, though and please do not take
this personally. I really just wanted to point out a few major flaws that can
easily be fixed and may give you an idea on why you received no feedback so far.

There is plenty of code and some of the points I mentioned above contribute to
the fact that especially beginners have a hard time understanding any of it.
A feature-laden, complex and poorly documented project like this is way above the
heads of your average I-just-did-guess-the-number-in-C++-type of beginner.
Plus with hardly any documentation at all, it even takes an experienced programmer
quite some time to follow your code.

This concludes my feedback and I want to end with a big kudos!

Thanks for sharing this,

Share this post

Link to post
Share on other sites

Thank you for responding to my post.
You comments are well taken so I thank you for them.

I did not learn C/C++ in expensive university.
I learned at home on my own by reading other source code.
I am also learning disabled with Autism.

I apologize to all who downloaded this source and were confused.


Share this post

Link to post
Share on other sites
I did not learn C/C++ in expensive university.
You don't have to go to school to learn idiomatic C++ :) In fact, a lot of the C++ coders you'll find around here are entirely self-taught.
I learned at home on my own by reading other source code.
Yes, that can certainly lead to a mixing of C and C++ programming styles. A lot of game-related code you'll find online is either pure C, or is 'C with classes' (that is, C++, but using many C idioms). As such, it isn't necessarily the best reference material if you want to learn modern, idiomatic C++.

If you want to improve your C++ skills, there are plenty of good resources available; you can learn a lot from the technical forums here, and there are other good references online as well, such as the C++ FAQ Lite.

In any case, you've created a finished, working game, which is an impressive feat no matter what the code looks like :)

Share this post

Link to post
Share on other sites
Original post by jykIn any case, you've created a finished, working game, which is an impressive feat no matter what the code looks like :)

Thank you for your comments.
My top priority is to create a fun and stable game.
All other priorities including source code are secondary.
I am by no means an expert source code writer...
...but I improve my skills with each new game project.


Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!