Skip to content
Snippets Groups Projects
Commit 7dc5630f authored by Fabian Heinrich's avatar Fabian Heinrich
Browse files

Removed unnecessary functions

parent 451033ac
No related branches found
No related tags found
1 merge request!8Resolve "Can put tomatos on returned plate"
Pipeline #41486 passed
......@@ -35,25 +35,6 @@ BOARD_COLOR = (239, 193, 151)
USE_COOK_SPRITE = False
def angle_between_vectors_old(v1, v2):
if np.linalg.norm(v1) != 0:
v1 = v1 / np.linalg.norm(v1)
if np.linalg.norm(v2) != 0:
v2 = v2 / np.linalg.norm(v2)
return np.arccos(np.clip(np.dot(v1, v2), -1.0, 1.0))
def angle_between_vectors(v1, v2):
from_vec = v1
to_vec = v2
norm = np.linalg.norm
angle = 2 * np.arctan2(
norm(from_vec / norm(from_vec) - to_vec / norm(to_vec)),
norm(from_vec / norm(from_vec) + to_vec / norm(to_vec)),
)
return angle
class PlayerKeySet:
"""Set of keyboard keys for controlling a player.
First four keys are for movement. Order: Down, Up, Left, Right.
......@@ -229,9 +210,7 @@ class PyGameGUI:
self.screen.blit(image, rect)
if isinstance(item, Plate):
image = pygame.image.load(
self.images_path / "plate.png"
).convert_alpha()
image = pygame.image.load(self.images_path / "plate.png").convert_alpha()
rect = image.get_rect()
rect.center = pos
self.screen.blit(image, rect)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment