Example #1
0
    def __init__(self, surface, score=0):
        self.surface = surface

        self.pumpkin = Pumpkin(self.surface, 0.5)

        self.font = pygame.font.Font(None, 36)
        self.update_text(score)
Example #2
0
 def create_new_enemies_wave(self, enemy):
     if enemy is Ghost:
         for i in range(rnd.randint(1, self.difficulty.value[0])):
             pos = (-100 if rnd.randint(0, 100) % 2 == 0 else WIDTH + 100,
                    rnd.randint(0, HEIGHT))
             self.entities.append(Ghost(pos))
     if enemy is Pumpkin:
         pos = (self.player.rect.centerx, -50)
         self.entities.append(Pumpkin(pos))
Example #3
0
 def create_entities(self):
     self.entities = [
         Ghost((rnd.randint(-200,
                            0), rnd.randint(0, self.display.HEIGHT // 4))),
         Pumpkin((rnd.randint(0, WIDTH), -100))
     ]
     self.player = Player(
         (self.display.WIDTH / 2, self.display.HEIGHT - 200),
         'player_stand')
Example #4
0
 def __init__(self):
     super(Carving, self).__init__()
     self.brush_size = 8
     self.drawing = False
     self.pumpkin = Pumpkin()
     self.line_start = None
     self.shade = pg.Surface(prepare.SCREEN_SIZE).convert()
     self.shade.fill(pg.Color(10, 5, 20))
     self.shade_alpha = 255
     self.shade.set_alpha(self.shade_alpha)
     self.animations = pg.sprite.Group()
     self.brush_timer = 0
     self.brush_cooldown = 50
     self.layer_num = 0
     self.buffer_dict = {}