A* pathfinding algorithm in Pygame