From be77bf984cd1f3571f27f3477a1a74b24dc5b669 Mon Sep 17 00:00:00 2001 From: Julian Date: Wed, 31 Jan 2024 21:23:43 +0100 Subject: [PATCH] Added Spawn Function to Player --- src/main/java/pacmanGame/Player.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/pacmanGame/Player.java b/src/main/java/pacmanGame/Player.java index c8c2e48..fb8c3f0 100644 --- a/src/main/java/pacmanGame/Player.java +++ b/src/main/java/pacmanGame/Player.java @@ -11,6 +11,11 @@ public class Player { this.direction = new Vector2(0,-1); } + public void Spawn() { + position = gameManager.map.playerSpawn; + direction = new Vector2(0, -1); + } + public void Move() { Vector2 newPosition = position.Add(direction);