# Boyd, the friendly, misunderstood turnip loving, light hating space mould
+import random
+
import pymunk
import pymunk.pygame_util
import pygame.draw
import pygame.locals as pgl
from .constants import SCREEN_SIZE, MOULD_CATEGORY, OBSTACLE_CATEGORY
+from .loader import loader
MOULD_FILTER = pymunk.ShapeFilter(
mask=MOULD_CATEGORY | OBSTACLE_CATEGORY,
def get_image(self):
if not self._img:
- img = pygame.surface.Surface((32, 32))
- img.convert_alpha(pygame.display.get_surface())
- img.fill((0, 0, 0, 0))
- pygame.draw.circle(img, (255, 255, 255, 255), (16, 16), 16)
- self._img = img
+ name = random.choice(
+ ('mouldA.png', 'mouldB.png', 'mouldC.png'))
+ self._img = loader.load_image("32", name)
return self._img
def tick(self, gamestate, space, moulds):
if (self._age % 15) == 0 and len(moulds) < 1000:
# Spawn a new child, if we can
spawn = True
- import random
choice = random.randint(0, 4)
if choice == 0:
pos = self.position + (0, 24)