diff nagslang/screens/area.py @ 84:ef8e799477e0

Point pymunk at a screen surface, not the display to make things saner
author Neil Muller <drnlmuller@gmail.com>
date Sun, 01 Sep 2013 22:54:53 +0200
parents d7beca6b6762
children a5c839994d41
line wrap: on
line diff
--- a/nagslang/screens/area.py	Sun Sep 01 22:58:04 2013 +0200
+++ b/nagslang/screens/area.py	Sun Sep 01 22:54:53 2013 +0200
@@ -40,7 +40,7 @@
     def add_walls(self):
         self.walls = []
         body = pymunk.Body()
-        body.position = (0, -300)
+        body.position = (0, 0)
         walls = self._level.get_walls()
         for wall in walls:
             corners = wall
@@ -69,10 +69,11 @@
     def render(self, surface):
         #surface.fill(pygame.color.Color(0, 0, 0))
         background = self._level.get_background()
-        surface.blit(background, (0, 0))
+        mysurface = background.copy()
         #pymunk.pygame_util.draw(surface, *self.walls)
-        self.protagonist.render(surface)
-        self.toy_switch.render(surface)
+        self.protagonist.render(mysurface)
+        self.toy_switch.render(mysurface)
+        surface.blit(mysurface, (0, 0))
 
     def tick_protagonist(self):
         dx, dy = 0, 0