Jump to content
  • Advertisement
Sign in to follow this  
garyfletcher

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

This topic is 4779 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

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]

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
Nice looking code. Never compiled it or played it but its nice looking code....

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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-

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!