def f(position, direction, momentum, shotgroup): for i in floatrange(spread, -1 * spread, numshots): if abs(i) > 0.0001: theta = abs(abs(i) - pi / 2) d = direction + i radius = dist / (2 * cos(theta)) period = ctime * (2 * pi) / (pi - 2 * theta) if abs(i) > pi / 2: period = ctime * (2 * pi) / (pi + 2 * theta) cc = COUNTERCLOCKWISE if i < 0: cc = CLOCKWISE sheading = momentum route = loop(radius, period, d, cc) + advance() else: route = advance() sheading = momentum + vectorfromangle(direction).mult(300.0/ctime) size = 1 lifetime = ctime * 2 s = Shot(position=position, heading=sheading, image=image, size=size, route=route, lifetime=lifetime, payload=payload) shotgroup.add(s)
def f(position, direction, momentum, shotgroup): for i in floatrange(direction - spread, direction + spread, numshots): sheading = vectorfromangle(i, speed * -1) route = torpedo(direction, 0.1) + limit() + advance() size = 1 s = Shot(position, sheading, image, size, route) s.kick(momentum) shotgroup.add(s)
def f(position, direction, momentum, shotgroup): for i in floatrange(width, width * -1, numshots): z = vectorfromangle(direction + pi /2, i) p = position + z sheading = vectorfromangle(direction, speed) + momentum size = 1 if i > 0: c = COUNTERCLOCKWISE else: c = CLOCKWISE route = loop(abs(i), period, direction, c) + advance() s = Shot(position=p, heading=sheading, image=image, size=size, route=route, payload=payload) shotgroup.add(s)
def f(position, direction, momentum, shotgroup): for i in floatrange(direction - spread, direction + spread, numshots): sheading = vectorfromangle(i, speed) + momentum s = Shot(position=position, heading=sheading, image=image, route=advance(), payload=payload, lifetime=lifetime) shotgroup.add(s)
def f(position, direction, momentum, shotgroup): d = direction - random.uniform(-1 * spread,spread) sheading = vectorfromangle(d, speed) + momentum s = Shot(position=position, heading=sheading, image=image, route=advance(), payload=payload, lifetime=lifetime) shotgroup.add(s)