Create the sling movement as seen on Slingy Flash game with Stencyl

Some time ago I released Slingy, a Flash game featuring a sling-like movement which has been explained in the post Flash Elasticity prototype – AS3 version.

Today I will show you how to achieve the sling movement using Stencyl.

First, we need four attributes called Friction, Speed Scale, X Speed and Y Speed.

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:

Ball, 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