-
Notifications
You must be signed in to change notification settings - Fork 0
/
abilities.py
executable file
·31 lines (30 loc) · 1.1 KB
/
abilities.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
class DashAbility:
def __init__(self):
self.name = 'DashAbility'
self.speed = 28
self.cooldown = 0
self.maxcooldown = 120
def use(self):
self.cooldown = self.maxcooldown
class PounceAbility:
def __init__(self):
self.name = 'PounceAbility'
self.xspeed = 12
self.yspeed = -18
self.cooldown = 0
self.maxcooldown = 300
def use(self):
self.cooldown = self.maxcooldown
def update(self, character, direction):
if direction == 'left':
character.dx = -self.xspeed
elif direction == 'right':
character.dx = self.xspeed
character.dy = self.yspeed
class ThrowKnifeAbility:
def __init__(self):
self.name = 'ThrowKnifeAbility'
self.cooldown = 0
self.maxcooldown = 180
def use(self):
self.cooldown = self.maxcooldown