# CreateRopeJoint

## Description

Creates a rope joint between two sprites. The rope joint enforces a maximum distance between the sprites without any other restrictions. It does not stop them getting closer together. Specify two anchor points in world coordinates with the maximum length you want to allow, the current position of the sprites does not affect the initialisation of the joint. The anchor points can be offset from the sprite positions. A joint may be deleted by the system if any of the sprites it connects are deleted.

## Definition

integer CreateRopeJoint( iSpriteIndex1, iSpriteIndex2, x, y, x2, y2, maxLength, colConnected )

UINT agk::CreateRopeJoint( UINT iSpriteIndex1, UINT iSpriteIndex2, float x, float y, float x2, float y2, float maxLength, int colConnected )

CreateRopeJoint( iJointIndex, iSpriteIndex1, iSpriteIndex2, x, y, x2, y2, maxLength, colConnected )

void agk::CreateRopeJoint( UINT iJointIndex, UINT iSpriteIndex1, UINT iSpriteIndex2, float x, float y, float x2, float y2, float maxLength, int colConnected )

## Parameters

- iSpriteIndex1 - The ID of the first sprite to join.
- iSpriteIndex2 - The ID of the second sprite to join.
- x - The x coordinate of the sprite 1 anchor point.
- y - The y coordinate of the sprite 1 anchor point.
- x2 - The x coordinate of the sprite 2 anchor point.
- y2 - The y coordinate of the sprite 2 anchor point.
- maxLength - The maximum length allowed between the sprite anchor points.
- colConnected - Set whether the two sprites connected by the joint can collide with one another, 0=no, 1=yes.
- iJointIndex - The ID to use for this joint.