diff mamba/engine.py @ 38:047273a63054

Main menu says hello
author Stefano Rivera <stefano@rivera.za.net>
date Sun, 11 Sep 2011 14:57:11 +0200
parents b38411d253e3
children e5f36843f7cd
line wrap: on
line diff
--- a/mamba/engine.py	Sun Sep 11 14:49:07 2011 +0200
+++ b/mamba/engine.py	Sun Sep 11 14:57:11 2011 +0200
@@ -1,8 +1,11 @@
 """Game engine and top-level game loop."""
 
+from mamba.constants import SCREEN
 from mamba.widgets.base import Container
+
 import pygame.event
 import pygame.display
+import pygame
 from pygame.locals import QUIT, USEREVENT
 
 
@@ -31,13 +34,16 @@
 class Habitat(object):
 
     def __init__(self):
+        self.surface = pygame.Surface(SCREEN)
         self.container = Container()
 
     def dispatch(self, ev):
         self.container.event(ev)
 
     def draw(self, surface):
-        self.container.draw(surface)
+        self.surface.fill(pygame.Color('black'))
+        self.container.draw(self.surface)
+        surface.blit(self.surface, self.surface.get_rect())
 
 
 class UserEvent(object):