sprite.lifetime
Category:Sprites
Examples
var sprite = createSprite(200, 200);
sprite.lifetime=50;
function draw() {
background("white");
drawSprites();
}
Syntax
sprite.lifetime
Returns
The lifetime of the sprite.
Tips
- Sprites all have the same properties and you use the dot notation (combining the name of the sprite, followed by a dot, with the label of the property) to both access and update the property for that sprite.
- Any changes to the properties of a sprite will not be seen until after
drawSprites()
is called.
Found a bug in the documentation? Let us know at support@code.org.