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

  • Home
  • SEARCH
  • 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 7014689
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:33:15+00:00 2026-05-27T22:33:15+00:00

I have a class in my game called Core where most Managers reside. They

  • 0

I have a class in my game called Core where most Managers reside. They go here because all my resources, language data, bitmaps, sounds get loaded by the managers when the game starts up.

After that, the scene manager is created and it initializes the first scene.

The issue comes with sharing data from upper level classes to lower level classes such as scenes.

When a scene starts, it needs to request bitmaps and sounds from the managers. Most scenes also need to look up words to put on buttons based on the language.

The way I do this is by having a sort of Manager manager class. It is constructed with each type of manager that most scenes use. This is passed to the scene manager which passes a pointer to the current scene.

This means each time I have a new manager, I need to change the constructor of the Manager manager and change a few things in the scene manager.

Is there a better way to do this? How is this sort of thing usually done?

Thanks

  • 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-05-27T22:33:15+00:00Added an answer on May 27, 2026 at 10:33 pm

    The most common way of doing this is with a singleton. Just because it’s common though, doesn’t mean it is the best way.

    A different way to do the same thing is dependency injection. The constructor for a class will take pointers to the managers that it requires. This gives the advantage of collecting all the dependencies in one place, and lets you substitute test code for any manager easily.

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

Sidebar

Related Questions

I have a core data class Game which has a to-many relationship to another
I'm making a game for the iPhone, and I have a class called Robot.
I'm making a game and I have a class called Man and a class
OK so I have a code with an class object called game. Every frame
I have an array that contains a custom class of mine called 'Game'. Each
I have a class called Console, with the following structure: public Console(Game game) {
In my little scratch built flex game framework, I have defined a class called
I have a class called game that extends View that is added to a
I have a class called Game that extends View. I have an xml called
OK, so i have a class called turret in a tower defense game and

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.