1st game with SDL engine (new and improved)- please take a look and comment

Started by
13 comments, last by Drew_Benton 18 years, 11 months ago
Hi there. I've been working on my SDL game engine for a couple of weeks now and I've just done my 1st game with it. It's actually mostly nicked from Cone's GFX with SDL tutorials...well except for the engine bit. I'd be really grateful if you'd take a look, have a play, look at the code and give me some feedback as to general design, things that need adding. Etc. I've got some of ideas about what to add, but it'd be nice to hear from the forum on this as well. Anyway the project is built with dev-c++ and can be found here if you fancy a go. Thanks. EDIT: Binary now included...just trying to save webspace..:) [Edited by - garyfletcher on April 26, 2005 12:57:37 AM]
Gary.Goodbye, and thanks for all the fish.
Advertisement
not to appear entirely too lazy, but is there any way we could get binaries?
Sorry... dont got the SDL installed. So you have to compile it for me. Yeah yeah call me lazy. :P
Nice looking code. Never compiled it or played it but its nice looking code....
Cone3D Clickomania...

I was a bit confused as to how to play as some of the tiles seem to randomly change..... Well, congrats on going through a tutorial at Cone3D. You seem to have left a bunch of images that you don't use inside the zip from some of the other Cone3D tutorials. Now maybe you can develop your own game?

... Sorry... Because I think I seemed a bit harsh there, I've decided to help your out with the bandwidth situation. I've made a mirror of only the binary with SDL.DLL:
Binary + SDL.DLL.
Rob Loach [Website] [Projects] [Contact]
Thanks Rob.

Not being harsh at all. Used Cone's clickomania coz it seemed simple and wanted to test out the engine...see if I could put the theory into practise..:)

You don't really seem too impressed with the Cone's tutorials? It has been difficult finding decent tutorials on SDL. Am sure there are plenty out there though..and I've learned a lot goign thru Cone's. Am still planning to do the last one as well..:)

Thanks again.
Gary.Goodbye, and thanks for all the fish.
Everything seems to just randomely move, instead of falling into place
OK. I think I've sorted out the problem with random balls being deleted and I've added continuation options when a) no move are available and b) the board is cleared.

please take a look and let me know what you think.
Gary.Goodbye, and thanks for all the fish.
Looks very good! One suggestion might be the speed of those remaining balls dropping down. Maybe you could slow the dropping a bit. But it works great.

Crafter 2D: the open source 2D game framework

?Github: https://github.com/crafter2d/crafter2d
Twitter: [twitter]crafter_2d[/twitter]

If you're interested in some comments on the code, too, here are some things I noticed when looking over it:

* Your include guard in globals.h starts with a double underscore, which is not legal because these names are reserved for the compiler
* GameEngine.h has a lot of using statements sitting in the global namespace, thus pollute the same. This wouldn't be half as bad if your game had its own namespace.
* Another thing about globals.h, constants are usually preferred to #defines in C++
* Minor: A better name for FRAME_RATE might be FRAME_INTERVAL_MS
* The GameEngine is quite a specialized class just for this single game (e.g. you can't use it for another game), so I wouldn't say it's a game engine, but the ClickomaniaEngine or something like that ;)
* I would have written a helper function for obtaining the resolution in main() and constructed the GameEngine instance on the stack (you're using new, thus allocate on the heap)
* Instead of the catch(...) you could catch(const std::exception &e) and then display e.what() to obtain an understandable error message. Global catching of all exceptions tends to make debugging quite hard.

But all in all, it is well commented, you've got a consistent coding style and I can't spot any obvious bugs. Clearly one of the better examples on how to use SDL!

-Markus-
Professional C++ and .NET developer trying to break into indie game development.
Follow my progress: http://blog.nuclex-games.com/ or Twitter - Topics: Ogre3D, Blender, game architecture tips & code snippets.

This topic is closed to new replies.

Advertisement