Ejemplo n.º 1
0
	float CalculateGhostEffect(const PathNode& in_node, const std::vector<const Pawn* const> in_ghosts)
	{
		float score = 0;
		for(auto ghost : in_ghosts)
		{
			score += (ghost->GetPosition() - in_node.GetPosition()).MagnitudeSqr() / 1.0f;
			if (ghost->GetClosestNode() == in_node.GetId())
				score += 1000;

			//When blue boost our want to go towards the ghost
			if (ghost->GetState() == 2)
				score = -score;
		}

		return score;
	}
Ejemplo n.º 2
0
	//Calculates the straight line distance between the currently node in examination and the target node
	float huristic(const PathNode& aNode, const PathNode& bNode)
	{
		return (bNode.GetPosition() - aNode.GetPosition()).Magnitude();
	}