-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paththruball.py
34 lines (29 loc) · 826 Bytes
/
thruball.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 numpy as np
from colorama import Back, Fore, Style
from powerup import Powerup
class Thruball(Powerup):
def __init__(self, pos, start_time):
super().__init__(pos, start_time)
self._ascii = np.array(
[Back.BLUE + "T", Back.BLUE + "B"], dtype="object"
).reshape(1, -1)
self._kind = "thruball"
def magic(self, balls):
"""
expand the paddle
"""
new_balls = []
for ball in balls:
ball._thru = True
new_balls.append(ball)
return new_balls
def reverse(self, balls):
"""
deactivate the powerup
"""
self._state = "DELETE"
new_balls = []
for ball in balls:
ball._thru = False
new_balls.append(ball)
return new_balls