-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathefects.py
More file actions
40 lines (28 loc) · 866 Bytes
/
efects.py
File metadata and controls
40 lines (28 loc) · 866 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import pygame
# CONSTANTES
RED = (255, 0, 0)
BLACK = (0, 0, 0)
BLUE = (0, 0, 255)
WHITE = (255, 255, 255)
class Explosion:
def __init__(self, position):
self.position = position
self.picture = pygame.image.load("pictures/boom.png")
self.picture.set_colorkey(WHITE)
self.iterations = 0
self.sound = pygame.mixer.Sound("sounds/explosion.ogg")
def get_picture(self):
return self.picture
def get_position(self):
return self.position
def play_sound(self):
self.sound.play()
def get_iterations(self):
return self.iterations
def increase_iterations(self):
self.iterations += 1
class LevelUp:
def __init__(self, position):
self.position = position
self.picture = pygame.image.load("pictures/.png")
self.picture.set_colorkey(WHITE)