added soil background for day and night; recoloured seed
[tabakrolletjie.git] / tabakrolletjie / scenes / day.py
index a3e43475d72e63d36edde6cf4997a109cd0b1bcf..c28070203c20d6dd7b872af17807988844e1d716 100644 (file)
@@ -1,6 +1,7 @@
 """ Be prepared. """
 
 import pygame.locals as pgl
+import pygame.surface
 
 import pymunk
 import pymunk.pygame_util
@@ -44,7 +45,7 @@ class DayScene(BaseScene):
             ImageButton('32', 'default_cursor.png', name='reset tool',
                         pos=(SCREEN_SIZE[0] - 50, SCREEN_SIZE[1] - 40)),
         ]
-        self._update_toolbar()
+        self._update_toolbar(gamestate)
 
     def exit(self, gamestate):
         self._unset_cursor()
@@ -55,7 +56,12 @@ class DayScene(BaseScene):
 
     @debug_timer("day.render")
     def render(self, surface, gamestate):
-        surface.fill((0, 0, 155))
+        surface.blit(loader.load_image("textures", "soil.png"), (0, 0))
+        brightness = pygame.surface.Surface(surface.get_size())
+        brightness = brightness.convert_alpha()
+        brightness.fill((255, 255, 255, 50))
+        surface.blit(brightness, (0, 0))
+        
         for turnip in self._turnips:
             turnip.render(surface)
         self._lights.render_light(surface)
@@ -100,7 +106,7 @@ class DayScene(BaseScene):
                             turnip = Turnip(age=0, pos=pos, space=self._space)
                             self._turnips.append(turnip)
                             self._seeds -= 1
-                            self._update_toolbar()
+                            self._update_toolbar(gamestate)
                         except TurnipInvalidPosition as e:
                             # TODO: Add error sound or something
                             pass
@@ -114,7 +120,9 @@ class DayScene(BaseScene):
         if not self._paused:
             self._lights.tick()
 
-    def _update_toolbar(self):
-        text = "Turnip Stocks: Seeds: %d. Planted: %d. Harvested: %d" % (
-            self._seeds, len(self._turnips), self._harvested)
+    def _update_toolbar(self, gamestate):
+        text = ("Turnip Stocks: Seeds: %d. Planted: %d. "
+                "Harvested: %d. Destroyed: %d" % 
+                (self._seeds, len(self._turnips),
+                 self._harvested, gamestate.eaten))
         self._toolbar = self._toolbar_font.render(text, True, (255, 255, 255))