game: add: paddle collision

This commit is contained in:
2024-02-22 16:39:37 +01:00
parent 8fa282da9d
commit 4eeb5ad102
2 changed files with 30 additions and 20 deletions

View File

@ -10,8 +10,8 @@ class Segment:
self.start: Point = start
self.stop: Point = stop
def angle(self):
return math.atan2((self.start.x - self.start.y), (self.stop.x - self.stop.y))
def angle(self) -> float:
return math.atan2((self.start.y - self.stop.y), (self.start.x - self.stop.x))
def length(self):
return self.start.distance(self.stop)