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.

start lantern effect

Problem it solves

You are making a spooky dungeon game and want the screen to be pitch black except for a glowing circle of light centered on the player.

What this block does

Turns on the single-lantern darkness effect and anchors the glowing circle of light to follow a specified sprite.

The block

true block

Parameters

NameTypeDefaultMeaning
anchorSpritemySpriteThe sprite that the center of the lantern light will follow.

Example

let player = sprites.create(img`.`, SpriteKind.Player)
controller.moveSprite(player)
lantern.startLanternEffect(player)

Add the extension

Add github:felixtsu/pxt-lantern to your project, or open: Import pxt-lantern.