Oct-17-2021, 01:31 AM
Doesn't make it wrong. Just make program less flexible. Frame rate shouldn't be a global or a constant. I Would just wrap it as Setting class. Then make variable in share data class. Then you can just pass one class to handle all data. Good thing about classes. They are reference. So passing is low memory and fast.
Anyone can program. Only a few can program well.
class Setting: def __init__(self): self.end_time = 180Then I put it in my game manger.
class GameManager: def __init__(self, *args, **kwargs): self.setting = Setting() self.game_data = GameData() self.gfx = self.game_data.texturesThen I would pass manager to scene/state. This way every state that inherit will already have access to data.
class Scene: def __init__(self, manager): self.manager = manager self.gfx = manager.gfxHope this help you to find your style.
Anyone can program. Only a few can program well.
99 percent of computer problems exists between chair and keyboard.