-
Notifications
You must be signed in to change notification settings - Fork 0
/
skill_selector.py
34 lines (27 loc) · 971 Bytes
/
skill_selector.py
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
import random
# from config import *
import player
from player import *
from config import *
class Skill(pygame.sprite.Sprite):
def __init__(self):
global vector
vector = ['img/slow_opponent.png',
'img/freeze_opponent.png',
]
pygame.sprite.Sprite.__init__(self)
self.position_x = 450
self.position_y = 300
self.active = False
self.name = ""
self.player = 0
self.image = pygame.image.load('{}'.format(random.choice(vector)))
def render(self, surface, skill):
surface.blit(skill.image, (self.position_x, self.position_y))
def set_image(self, skill):
string_vetor = random.choice(vector)
if string_vetor == 'img/slow_opponent.png':
skill.name = "slow"
else:
skill.name = "freeze"
skill.image = pygame.image.load('{}'.format(string_vetor))