Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9232065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:13:29+00:00 2026-06-18T06:13:29+00:00

I am developing a 2D game in C++ using SFML API, but I am

  • 0

I am developing a 2D game in C++ using SFML API, but I am having an issue with class design.
I think that I am disobeying the SRP (Single Responsibility Principle) because I have one main class called “Game” that should handle the window. It contains a method containing main game loop.
Now the problem; it contains object (composition) of more than 5 classes, such as Player, Menu, SplashScreen.
Do you think that it is a good idea to create such “God” class? Do you know any open source C++ 2D games from which I could learn?
Thank you in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T06:13:30+00:00Added an answer on June 18, 2026 at 6:13 am

    See this thread on the Gamedev site about God classes (yes, they are a bad idea because tight coupling makes code less robust in the face of change).

    Don’t know about 2D, but there is a whole GitHub repo with id-Software 3D game engines. Apart from the graphics, this should provide a treasure trove for you. See also the Doom source code review for ideas on good coding style for writing games.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi i am developing game level editor.Currently I am using win32 with directX.But with
I am developing an app that reports a score to Game Center using the
Hi I am developing a game using libgdx framework, in that i am unable
I am developing iphone game using coregraphics. but the speed is very slow. I
I'm currently developing an RPG game using C++ and SFML on Windows. Currently it
I'm currently developing a game on iPhone using the Cocos2D API. It's going well.
I'm developing a game using XNA 4.0 library (not using game class and ContentManager)
I'm developing a little snake game written in C++ and using SFML 2D library.
I have been developing a game using Flex, and used the Timer class to
I'm developing a game using the libGDX Framework. I'd like to implement an icon

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.