Display power usage per hour.
[tabakrolletjie.git] / tabakrolletjie / turnip.py
index f40478a1e79834ec64ff5433590c6820fa42664f..72705fccdf7aa18e3548357ffc14954e0d9a41a8 100644 (file)
@@ -14,6 +14,14 @@ TURNIP_FILTER = pymunk.ShapeFilter(
     categories=TURNIP_CATEGORY)
 
 
+def check_turnips(space, pos, max_distance):
+    point_info = space.point_query_nearest(
+        pos, max_distance, pymunk.ShapeFilter(mask=TURNIP_CATEGORY))
+    if point_info is not None:
+        return True
+    return False
+
+
 class TurnipInvalidPosition(Exception):
     pass
 
@@ -28,7 +36,7 @@ class Turnip(object):
         self._update_image()
         self.eaten = False  # Flag for boyd
         self._body = pymunk.Body(0, 0, pymunk.Body.STATIC)
-        self._shape = pymunk.Circle(self._body, 16)
+        self._shape = pymunk.Circle(self._body, 24)
         self._shape.filter = TURNIP_FILTER
         self._body.position = pymunk.pygame_util.from_pygame(
             self._pos, pygame.display.get_surface())
@@ -39,7 +47,7 @@ class Turnip(object):
         space.add(self._body, self._shape)
 
     def _update_image(self):
-        self._image = loader.load_image('32', 'turnip%d.png' % (self._age + 1))
+        self._image = loader.load_image('48', 'turnip%d.png' % (self._age + 1))
         self._image = pygame.transform.rotate(self._image, self._rotation)
 
     def render(self, surface):