|
|
@ -1,7 +1,9 @@ |
|
|
|
package pacmanGame; |
|
|
|
import java.util.Random; |
|
|
|
public class GhostBehaviorRandom implements GhostBehavior { |
|
|
|
|
|
|
|
public int player; |
|
|
|
public int ghost; |
|
|
|
public boolean isPlayerAlive = true; |
|
|
|
@Override |
|
|
|
public Vector2 GetDirection(Ghost ghost) { |
|
|
|
Random random = new Random(); |
|
|
@ -20,5 +22,9 @@ public class GhostBehaviorRandom implements GhostBehavior { |
|
|
|
} |
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
public void checkCollision() { |
|
|
|
if (player == ghost) { |
|
|
|
isPlayerAlive = false; |
|
|
|
} |
|
|
|
} |
|
|
|
} |