-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlaser.py
More file actions
26 lines (22 loc) · 735 Bytes
/
laser.py
File metadata and controls
26 lines (22 loc) · 735 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
from powerup import PowerUp
from ball import ball
import os
class laser(PowerUp):
def __init__(self, x, y, x_vel, y_vel):
icon="🔫"
super().__init__(x, y, x_vel, y_vel, icon)
def execute(self, board):
self.x=-1
self.y=-1
check_flag=0
for pow_up in board._powerups:
if isinstance(pow_up, laser) and pow_up.remaining_time>0:
pow_up.remaining_time=120
check_flag=1
if check_flag==0:
super().execute()
board._paddle.shoot=True
os.system("vlc --intf dummy --loop laserfinal.mp3 &")
def deactivate(self, board):
board._paddle.shoot=False
os.system("killall vlc")