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.

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

true block

Parameters

NameTypeDefaultMeaning
spriteSpritemySpriteThe 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.