Open DannyFranklin opened 3 days ago
import math
class SaucerDrone: def init(self, num_motors=4): self.motors = [100] * num_motors self.battery = 100 self.altitude = 0 self.position = [0, 0] # [x, y] self.velocity = [0, 0] # [vx, vy] self.is_flying = False self.drag_coefficient = 0.1
def apply_drag(self):
self.velocity[0] *= (1 - self.drag_coefficient)
self.velocity[1] *= (1 - self.drag_coefficient)
def move(self, dx, dy):
if self.is_flying:
self.velocity[0] += dx
self.velocity[1] += dy
self.apply_drag()
self.position[0] += self.velocity[0]
self.position[1] += self.velocity[1]
self.battery -= 0.1
print(f"Moving to position: {self.position}")
Describe the bug A clear and concise description of what the bug is.
To Reproduce Steps to reproduce the behavior:
Expected behavior A clear and concise description of what you expected to happen.
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context Add any other context about the problem here.