feat: add basic controls
This commit is contained in:
@@ -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,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user