Skip to content

Commit

Permalink
Issue #21: Make assignment of engine-vars to more clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
Nearoo committed Jul 16, 2015
1 parent a5c8936 commit 1c1eef2
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
8 changes: 7 additions & 1 deletion Engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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()

Expand Down
2 changes: 0 additions & 2 deletions GameActorController.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 0 additions & 1 deletion Graphics.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion Input.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
1 change: 0 additions & 1 deletion World.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1c1eef2

Please sign in to comment.