add light source
Problem it solves
You want the player, stationary torches, and glowing gems to each cast their own circular ring of light in a dark room.
What this block does
Attaches a circular light source to a sprite in the multi-light system with a specified glow size.
The block
Parameters
| Name | Type | Default | Meaning |
|---|---|---|---|
| sprite | Sprite | mySprite | The sprite that will emit circular light. |
| bandWidth | number | 4 | The width of the light bands, controlling how far the glow reaches. |
Example
let player = sprites.create(img`.`, SpriteKind.Player) multilights.toggleLighting(true) multilights.addLightSource(player, 6)
Add the extension
Add github:felixtsu/pxt-lantern to your project, or open: Import pxt-lantern.