Hi i am trying to create a 2d racing game and i am stuck with code to get my AI to go around the track could any1 help??
This is what i have currently got with a million errors
// Pathfollowing + seek behaviour
// To get acceleration which updates velocity
FollowPath(Object source, Path path, float pathOffset);
{
float pathPosition = path.getPathPosition(source.position);
float targetPathPosition = pathPosition + pathOffset;
Vector target = path.getPosition(targetPathPosition);
acceleration = Seek(source.position, target);
Vector velocity = new Vector();
velocity.x += acceleration.x * timeDelta;
velocity.y += acceleration.y * timeDelta;
// veclocity.x += acceleration.x * timeDelta;
// veclocity.y += acceleration.y * timeDelta;
}
Any help would be greatly appreciated thanks