remove light source
Problem it solves
A torch burned out or an enemy carrying a lantern was defeated, so you need that sprite to stop emitting light.
What this block does
Removes a sprite from the multi-light system so it no longer casts light on the screen.
The block
Parameters
| Name | Type | Default | Meaning |
|---|---|---|---|
| sprite | Sprite | mySprite | The sprite that should stop casting light. |
Example
let torch = sprites.create(img`.`, SpriteKind.Player) multilights.addLightSource(torch, 6) multilights.removeLightSource(torch)
Add the extension
Add github:felixtsu/pxt-lantern to your project, or open: Import pxt-lantern.