# HG changeset patch # User Neil Muller # Date 1315760990 -7200 # Node ID 1e9da4893d51c464ac3417f7ebeb86e65ff9fe15 # Parent ebd8f46cc5534df4c4003505e60ffcf34294f552 Add size parameter to habitats diff -r ebd8f46cc553 -r 1e9da4893d51 mamba/engine.py --- a/mamba/engine.py Sun Sep 11 19:05:20 2011 +0200 +++ b/mamba/engine.py Sun Sep 11 19:09:50 2011 +0200 @@ -40,15 +40,17 @@ class Habitat(object): - def __init__(self): + def __init__(self, size=SCREEN): + self.surface_size = size self.surface = None - self.container = Container(pygame.Rect((0, 0), SCREEN), root=True) + self.container = Container(pygame.Rect((0, 0), self.surface_size, + root=True)) def on_enter(self): """Called when this becomes the current habitat.""" # Create the surface here as flipping between editor and # other things kills pygame.display - self.surface = pygame.Surface(SCREEN) + self.surface = pygame.Surface(self.surface_size) def on_exit(self): """Called when this stops being the current habitat."""