Professional Documents
Culture Documents
Nasromh 1
Nasromh 1
Nasromh 1
class Shooter:
def __init__(self, x, y):
self.x = x
self.y = y
# Example usage:
shooter = Shooter(0, 0)
target_x = 10
target_y = 20
print("Shooter coordinates:", shooter.x, shooter.y)
print("Target coordinates:", target_x, target_y)
# Simulate firing
shooter.fire(target_x, target_y)
import math
# Target coordinates
target_x = 10
target_y = 20
# Shooter coordinates
shooter_x = 0
shooter_y = 0
# Calculate angle to aim
angle_to_target = math.atan2(target_y - shooter_y, target_x - shooter_x)