Path Creation API


Powerups Template Code

Path Creation API

Before this, balloons have moved in straight lines. That’s cool and all, but what if we wanted to implement some maps like this?

Interface

Obviously, straight lines are not going to cut it. Instead, we need a way to implement curves, and we need to have some tools that will make it easy for us to smoothly connect them. As a result, we developed an API (a set of useful functions) that will help us do this.

//1
addLine(startPointX,startPointY,endPointX,endPointY);

//2
addArc(startPointX,startPointY,centerPointX,centerPointY, angleOfRotation);

//3
addSmoothLine(lineLength);

//4
addSmoothArc(distanceAwayFromPathTip, angleOfRotation);
addLine(startPointX, startPointY, endPointX, endPointY);
addArc(startPointX, startPointY, centerPointX, centerPointY, angleOfRotation);
addSmoothLine(lineLength);
addSmoothArc(distanceAwayFromPathTip, angleOfRotation);