What it does
CloneSprite brings a Sprite object into being: it is how the rest of the program comes to have one. It takes iSpriteIndex (an integer) and iOtherSprite (an integer), and returns nothing. That is the first of 2 forms. iSpriteIndex is the id you are giving a Sprite object: every later call names it by that number.
Syntax
1
CloneSprite(iSpriteIndex integer, iOtherSprite integer)2
CloneSprite(iOtherSprite integer) → integerParameters
| Name | Type | In forms |
|---|---|---|
| iSpriteIndex | integer | 1 |
| iOtherSprite | integer | all |
What each form returns
| 1 | CloneSprite(1, 1) | nothing |
| 2 | sprite = CloneSprite(1) | integer |
Example · generated
Form 1, you choose the id yourself
CloneSprite(1, 1)DO Sync()LOOPForm 2, the command hands back the id
sprite = CloneSprite(1)DO Sync()LOOPCloneSprite is called with values of the types its signature asks for. The DO … LOOP is not decoration: a classic BASIC program ends the moment it runs out of lines, and Sync() is what draws the frame.