SpritePhysicsAllowSleep

Family: Sprite · One form

What it does

SpritePhysicsAllowSleep sets PhysicsAllowSleep on a Sprite object. It takes iSpriteIndex (an integer) and sleep (an integer), and returns nothing. iSpriteIndex is the id of a Sprite object, the one CreateSprite returned: it is how the call knows what to act on.

Syntax

SpritePhysicsAllowSleep(iSpriteIndex integer, sleep integer)

Parameters

NameType
iSpriteIndexinteger
sleepinteger

Every form returns

nothing

Example · generated

image = LoadImage("assets/sprite.png", 1)sprite = CreateSprite(image)SpritePhysicsAllowSleep(sprite, 1)DO  Sync()LOOP

LoadImage and CreateSprite are there to give the call something to act on; SpritePhysicsAllowSleep is the line that matters. 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.

135 commands in Sprite