def Update(): global spawntimer,mult spawntimer = spawntimer + 1 if(spawntimer % 300 == 0): for i in range(1,11): bullet = Bullet(0, 180,"s.png") bullet.SetVar('timer', 0) bullet.SetVar('offset', math.pi * i/5) bullet.SetVar('negmult', mult) bullet.SetVar('lerp', 0) objects.append(bullet) mult+=0.05 for bullet in objects: timer = bullet.GetVar('timer') offset = bullet.GetVar('offset') lerp = bullet.GetVar('lerp') posx = (70*lerp)*math.sin(timer*bullet.GetVar('negmult') + offset) posy = (70*lerp)*math.cos(timer + offset) + 180 - lerp*50 bullet.MoveTo(posx, posy) bullet.SetVar('timer', timer + 1/40) lerp+= 1 / 90 if lerp > 4: lerp=4 bullet.SetVar('lerp', lerp)
def Update(): global spawntimer if spawntimer % 5 == 0: bullet = Bullet(0, 0, "s.png") bullet.SetVar('angle', 0) bullet.SetVar('radius', 0) objects.append(bullet) ##for recognition for bullet in objects: angle = bullet.GetVar('angle') radius = bullet.GetVar('radius') bullet.MoveTo(math.cos(angle) * radius, math.sin(angle) * radius) bullet.SetVar('angle', angle + math.pi / 32) bullet.SetVar('radius', radius + 3) spawntimer += 1 return None