Today I will show you how to achieve the sling movement using Stencyl.
First, we need four attributes called
X Speed and
Their starting values are respectively 0.95, 0.04, 0 and 0. Changing Friction and Speed Scale values heavily affects gameplay, so choose the values wisely.
Once we are done with the attributes, let’s see the actors:
Big Circle and
Little Marker are respectively the ball itself, the big circle used to swing the little marker, and the little marker which we will control with the mouse.
Also, the scene itself is very easy:
We only have some tiles (which we will use in another tutorial), and the three actors all placed on 320,240 which is the center of the stage.
Now, the two behaviors which have been easily ported from the AS3 example:
Little marker follows mouse, attached to
Little Marker, which handles marker position according to mouse position
Ball follows marker, attached to
Ball, which handles ball movement
And this is the result:
Swing the ball moving the mouse