Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Stuck and need some help

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

Okay here''s the situation. I''m halfway through coding my first complete game, and I''m stuck as to what to do next. No matter what my design is, sooner or later, I end up with one giant MainApp class which contains all the object/sound/network stuff for the game.. It''s becoming rather large and unruly.. From those of you who''ve finished a game, how did you structure it? (Vague I know, but I think you can tell what I''m getting at).. I don''t want to create the "perfect" design, but at the same time, I''m not liking the prospect of one giant class.. THANKS!

Share this post

Link to post
Share on other sites
break it up into logical chunks... for example, have a class that handles the networking stuff, a class for sounds & music, a class for game logic, a class for rendering, etc. i can''t give more details without knowing more about your game, but the basic idea is to group things in groups that make sense.
then you have to figure out how the classes will communicate with each other. give the "sounds&music" class member functions for turning on the music, changing the song, playing a specified sound effect, etc. then, give the game logic class the ability to call these functions...
because you are putting everything in one huge class, you might not need to use classes at all. if you aren''t creating a class heirarchy and using polymorphism, etc, you may as well just break the program up into several files of non-OOP code, and make the important functions global. what is the difference between "GlobalSoundManagerObject.PlayEffect(4)" and "PlaySoundEffect(4)", other than that you have to do a lot more typing to set up the first one.
don''t get all OOP-crazy if you don''t really need it is all i am saying.
just my 2 cents

Share this post

Link to post
Share on other sites

  • 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!