What about using math.sin
:
class shot:
def __init__(self,x,y,height,width,color):
self.x = x
self.y = y
self.time = 0
# [...]
for shot in shots:
shot.y = 700 - math.sin(math.radians(self.time)) * 500
shot.time += 1
if shot.time >= 180:
shot.time = 0
Or math.cos
:
for shot in shots:
shot.y = 200 + math.cos(math.radians(self.time)) * 500
shot.time += 1
if shot.time >= 360:
shot.time = 0
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…