feat: add basic controls

This commit is contained in:
2025-10-18 02:02:37 +02:00
parent 9c5f39b669
commit 6805e69509
3 changed files with 66 additions and 1 deletions

View File

@@ -1,6 +1,6 @@
from __future__ import annotations
from math import sqrt
from math import cos, sin, sqrt
class Vec:
@@ -55,3 +55,9 @@ class Vec:
def __repr__(self) -> str:
return f"Vec({self.x}, {self.y})"
def rotate(self, angle: float) -> Vec:
return Vec(
cos(angle) * self.x - sin(angle) * self.y,
sin(angle) * self.x + cos(angle) * self.y,
)