MakeCode Games!

A fan-made community library of MakeCode Arcade games. Visit MakeCode Arcade to make a game!

← Back to extensions

Lantern

Create dark levels with dynamic lighting effects like circular lanterns, glowing torches, and directional flashlights.

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

true block

Parameters

NameTypeDefaultMeaning
spriteSpritemySpriteThe sprite that will emit circular light.
bandWidthnumber4The 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.