diff --git a/Engine.py b/Engine.py index 8892836..4e06a74 100644 --- a/Engine.py +++ b/Engine.py @@ -39,7 +39,6 @@ def __init__(self, screen_size, fps): # Create the engine-wrapper: self.engine_wrapper = EngineWrapper - # Create instance of Graphics-Engine: self.graphics = Graphics(self.engine_wrapper,screen_size) # Create instance of World: @@ -51,6 +50,13 @@ def __init__(self, screen_size, fps): # Create sound-controller (not jet programmed...) self.sound = None + # Update references of engine_wrapper: + self.engine_wrapper.graphics = self.graphics + self.engine_wrapper.world = self.world + self.engine_wrapper.actors = self.actors + self.engine_wrapper.input = self.input + self.engine_wrapper.sound = self.sound + # Create pygame.Clock for fps-control self.CLOCK = pygame.time.Clock() diff --git a/GameActorController.py b/GameActorController.py index 5b6db9e..f151b40 100644 --- a/GameActorController.py +++ b/GameActorController.py @@ -10,8 +10,6 @@ class GameActorController: def __init__(self, engine_wrapper, log_level = logging.ERROR): # Update the engine_wrapper: self.engine_wrapper = engine_wrapper - self.engine_wrapper.actors = self - # All game-actors, sorted by instance id (id()) self.actors = {} # Create deletion buffer-list, so actors can't delete while updating: diff --git a/Graphics.py b/Graphics.py index 3634018..f715ec4 100644 --- a/Graphics.py +++ b/Graphics.py @@ -6,7 +6,6 @@ class Graphics(EngineController): def __init__(self, engine_wrapper, screen_size): # Update the engine_wrapper: self.engine_wrapper = engine_wrapper - self.engine_wrapper.graphics = self self.screen_size = screen_size self.SCREEN = pygame.display.set_mode(screen_size) diff --git a/Input.py b/Input.py index b22bfb2..8bef6f1 100644 --- a/Input.py +++ b/Input.py @@ -6,7 +6,6 @@ class Input(EngineController): def __init__(self, engine_wrapper): # Update the engine_wrapper: self.engine_wrapper = engine_wrapper - self.engine_wrapper.input = self self.events = pygame.event.get() self.pressed_keys = pygame.key.get_pressed() diff --git a/World.py b/World.py index 8bad7cb..6efac27 100644 --- a/World.py +++ b/World.py @@ -16,7 +16,6 @@ class World(EngineController): def __init__(self, engine_wrapper): # Update the engine_wrapper: self.engine_wrapper = engine_wrapper - self.engine_wrapper.world = self self.grid_size = (1, 1) # Size of grid in amount of tiles self.tile_size = (1, 1) # Size of indiv. tiles