Ejemplo n.º 1
0
        void createRope(VerletWorld world)
        {
            // create an array of points for our rope
            var linePoints = new Vector2[10];

            for (var i = 0; i < 10; i++)
            {
                linePoints[i] = new Vector2(30 * i + 50, 10);
            }

            var line = new LineSegments(linePoints, 0.3f)
                       .pinParticleAtIndex(0);

            world.addComposite(line);
        }