# Lanterns: improving the Multilights extension!

**URL:** https://forum.makecode.com/t/lanterns-improving-the-multilights-extension/33190
**Category:** Show & Tell
**Tags:** extension, graphics-and-math
**Created:** [January 16, 2025, 11:41pm UTC](https://forum.makecode.com/t/lanterns-improving-the-multilights-extension/33190 "2025-01-16T23:41:08Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![WoofWoof](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/woofwoof/32/32523_2.png) [@WoofWoof](https://forum.makecode.com/u/WoofWoof)
#### Post date: [January 16, 2025, 11:41pm UTC](https://forum.makecode.com/t/lanterns-improving-the-multilights-extension/33190/1 "2025-01-16T23:41:08Z")

</div>

You can import my version by searching “WoofWoofCodes/lanterns”  
in the extensions search bar!

Demo:

> **[lanterns demo](https://arcade.makecode.com/S72646-83069-46549-68348)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

Credit where credit is due:

The original single-light-source version, @richard’s lantern extension, can be found [here](https://forum.makecode.com/t/a-darker-falling-duck-game/67/8) and the extension that I modified, @felixtsu’s Multilights extension, can be found [here](https://forum.makecode.com/t/hope-this-ext-can-bring-some-light-s/3229)!

Thank you both for your work on this!!!

(I hadn’t used GitHub before this project, so mine isn’t a fork of Multilights like Multilights is a fork of lantern, sorry.)

> **Why?**
>
> As I said [here](https://forum.makecode.com/t/weekly-topic-goals-and-resolutions/32998/4) I really want to get into making extensions and what better way than to start by editing one!? I picked this one because of [this](https://forum.makecode.com/t/how-come-mulitilights-extension-is-missing-a-light-band/21634) post from @Luke about how the Multilights extension was not really complete. I thought it might be an easy fix (lol it was, it was just hard to find).

> **Added features**
>
> - added options for controlling the shiver effect of light sources
> - added the ability to change the center radius of a circle light source
> - added the ability to change which light level a flashlight is at (full bright is darkness 0)
> - added the ability to change the “Shader Ramp” image (idk what else to call it) (explanation coming soon. Check the comments!)

> **Bug fixes**
>
> - fixed the issue Luke was talking about with the missing light bands
> - fixed weird missing lines in flashlight and circle light (really there were like 4 separate bugs doing that lol) (floating point imprecision is so annoying!)

> **Bugs that aren’t squashed yet**
>
> There are probably going to be many bugs that happen when setting values too large or in the negative. For the most part I won’t fix these because… well… just don’t set the values like that and you’ll be fine.
> 
> Here are just a few I know about:
> 
> - making a flashlight angle range above 90 results in… more interesting effects the higher you go (I don’t think I’m gonna fix this one, sorry!)
> - negative flashlight darkness levels error
> - negative circle center radius errors once (I think) the band width + the center radius is less than 0 (or equal to it? I haven’t done a lot of testing)

> **set Shader Ramp explanation??**
>
> If I haven’t made an explanation for how the “set Shader Ramp” block works yet, you can try to look in the demo project and see what it’s doing. Just keep in mind the dimensions of that image if you are making your own, and also read what the comment on that block says.

> **reporting bugs**
>
> If you find bugs, please report them! If it’s something you can recreate, please comment with the simplest project you can make that recreates the bug. This makes it much easier to tell what exactly is causing it. If you can’t recreate the bug, sending a screenshot with an explanation and (preferably) your project code is fine.

Anyways, have fun with this!! The are definitely more than just darkness effects possible if you know what you’re doing. I look forward to seeing them!! Off the top of my head there’s a very cool shockwave effect that I’m planning on using in the future…

---

<div class="post-metadata">

### Author: ![redSprite](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/redsprite/32/34262_2.png) [@redSprite](https://forum.makecode.com/u/redSprite)
#### Post date: [January 17, 2025, 1:12am UTC](https://forum.makecode.com/t/lanterns-improving-the-multilights-extension/33190/2 "2025-01-17T01:12:58Z")

</div>

So this is really cool!!!  
What else can we do with this?

---

<div class="post-metadata">

### Author: ![Luke](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/luke/32/32519_2.png) [@Luke](https://forum.makecode.com/u/Luke)
#### Post date: [January 17, 2025, 1:13am UTC](https://forum.makecode.com/t/lanterns-improving-the-multilights-extension/33190/3 "2025-01-17T01:13:00Z")

</div>

thank you sm!!!

---

<div class="post-metadata">

### Author: ![WoofWoof](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/woofwoof/32/32523_2.png) [@WoofWoof](https://forum.makecode.com/u/WoofWoof)
#### Post date: [January 17, 2025, 1:13am UTC](https://forum.makecode.com/t/lanterns-improving-the-multilights-extension/33190/4 "2025-01-17T01:13:06Z")

</div>

Just noticed that there is no “remove flashlight from (sprite)” block, so I will have that added soon, most likely by tomorrow! The original Multilights extension is also missing that! 😆

---

<div class="post-metadata">

### Author: ![JtSpeedRun](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jtspeedrun/32/33167_2.png) [@JtSpeedRun](https://forum.makecode.com/u/JtSpeedRun)
#### Post date: [January 17, 2025, 6:01pm UTC](https://forum.makecode.com/t/lanterns-improving-the-multilights-extension/33190/5 "2025-01-17T18:01:27Z")

</div>

Awesome extension! Something I didn’t know I needed but now I’m definitely using it! Maybe in an upcoming project.

---

<div class="post-metadata">

### Author: ![randomuser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/randomuser/32/32505_2.png) [@randomuser](https://forum.makecode.com/u/randomuser)
#### Post date: [January 17, 2025, 6:01pm UTC](https://forum.makecode.com/t/lanterns-improving-the-multilights-extension/33190/6 "2025-01-17T18:01:29Z")

</div>

Awesome!!

> [@WoofWoof](#):
>
> I haven’t made an explanation for how the “set Shader Ramp” block works yet

But what is this 👀

---

<div class="post-metadata">

### Author: ![WoofWoof](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/woofwoof/32/32523_2.png) [@WoofWoof](https://forum.makecode.com/u/WoofWoof)
#### Post date: [January 17, 2025, 6:01pm UTC](https://forum.makecode.com/t/lanterns-improving-the-multilights-extension/33190/7 "2025-01-17T18:01:33Z")

</div>

Done! I also fixed issues with the flashlight and circle light sometimes not disappearing after the sprite is destroyed.

---

<div class="post-metadata">

### Author: ![felixtsu](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/felixtsu/32/12024_2.png) [@felixtsu](https://forum.makecode.com/u/felixtsu)
#### Post date: [January 21, 2025, 5:28pm UTC](https://forum.makecode.com/t/lanterns-improving-the-multilights-extension/33190/8 "2025-01-21T17:28:19Z")

</div>

Very nice！

---

<div class="post-metadata">

### Author: ![WoofWoof](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/woofwoof/32/32523_2.png) [@WoofWoof](https://forum.makecode.com/u/WoofWoof)
#### Post date: [January 21, 2025, 6:18pm UTC](https://forum.makecode.com/t/lanterns-improving-the-multilights-extension/33190/9 "2025-01-21T18:18:59Z")

</div>

# set Shader Ramp explained!

Ok, here it is, the shader ramp explanation. This is gonna be a long one!

TLDR: the block lets you set which colors turn into which other colors at each light level.

> **you might want to sit down for this one**
>
> Ok, so, basically, this image is used to tell the shader which colors become which other colors at each light level. The image should be 16 x 6, though other sizes won’t really break anything.
> 
> **important note to remember: the first row in the image, the top one, is not used for anything. It is only there so that you can place all the colors in order, at the top, which makes editing it much easier**
> 
> If you look inside the [demo project](https://arcade.makecode.com/S72646-83069-46549-68348), you’ll see a version of the image that’s very close to what the normal, default version looks like, just with some extra dark grey pixels under yellow.  
> As you might have noticed if you looked at the simulator, this makes all the yellow pixels visible as dark grey, even in pitch black, outside of any light.
> 
> ![IMG_7219](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/4/c/4c73e6c0b23304a883b58107ad4f802918f524e8.jpeg)
> 
> This works because the 6th row of the image is used to shade what I’ll call “dark level 5”.  
> I’m going to call it that because the “darkness” level attribute that you can use on flashlight sources goes from 0 (fully bright) to 5 (full dark. Don’t use this though, it just makes your game more laggy for no reason)
> 
> If this is confusing, just pretend the first row doesn’t exist (because it really doesn’t) or think of it like arrays, with 0, the start, being no darkness at all.
> 
> Essentially, each row of the image is a different dark level, and each column represents a color.
> 
> The first column, on the left, represents color 0, which is clear, and the last column is color 15 (black) (this explains the image width of 16). For reference, colors in the image editor color picker are ordered right to left, top to bottom, and you can hover over them to see exactly what number they are.  
> **Any “clear” in the image will show up as the color black** , which is why there isn’t any black in the demo image: it isn’t needed.
> 
> If, for example, you wanted to make the color outside of the light something other than black, you would have to replace every clear pixel in the image with that color, so that every time it would be black, it’s your color instead!
> 
> That’s basically the whole explanation. One other thing is that, due to the way Richard coded it, and because I didn’t think it needed changing, there is an extra, unused row: dark level 4, which can only be used by a flashlight with darkness level 4. I wouldn’t be surprised if someone found a really cool use for that, so I’ll leave it in!

---

<div class="post-metadata">

### Author: ![randomuser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/randomuser/32/32505_2.png) [@randomuser](https://forum.makecode.com/u/randomuser)
#### Post date: [January 21, 2025, 7:41pm UTC](https://forum.makecode.com/t/lanterns-improving-the-multilights-extension/33190/10 "2025-01-21T19:41:59Z")

</div>

Woahh, that’s so cool! So you could theoretically just make it any color ramp you wanted, like a light fog or a hue shift!

---

<div class="post-metadata">

### Author: ![InvalidProject](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/invalidproject/32/32554_2.png) [@InvalidProject](https://forum.makecode.com/u/InvalidProject)
#### Post date: [January 22, 2025, 5:27pm UTC](https://forum.makecode.com/t/lanterns-improving-the-multilights-extension/33190/11 "2025-01-22T17:27:16Z")

</div>

holy! this is amazing! I could use this 100% for a lot of things, so I’ll be sure to use it. thanks so much @WoofWoof! :DDD

---

<div class="post-metadata">

### Author: ![TheManBehindTheWall](https://avatars.discourse-cdn.com/v4/letter/t/779978/32.png) [@TheManBehindTheWall](https://forum.makecode.com/u/TheManBehindTheWall)
#### Post date: [January 30, 2025, 6:24pm UTC](https://forum.makecode.com/t/lanterns-improving-the-multilights-extension/33190/12 "2025-01-30T18:24:30Z")

</div>

This is great! My school blocked downloads so github wouldn’t work, but now i can use this for my game, thanks!

---

<div class="post-metadata">

### Author: ![Luke](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/luke/32/32519_2.png) [@Luke](https://forum.makecode.com/u/Luke)
#### Post date: [February 19, 2025, 6:39pm UTC](https://forum.makecode.com/t/lanterns-improving-the-multilights-extension/33190/13 "2025-02-19T18:39:45Z")

</div>

![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/e/5/e55bec85090b7c47d78bb48d9e59a79c126e0ed0.png)

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/e/6/e6298199a4ea4a39c69bf19ecd411b85046dc81c.png)  
i love this extension

---

<div class="post-metadata">

### Author: ![Awesomefreez](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/awesomefreez/32/24832_2.png) [@Awesomefreez](https://forum.makecode.com/u/Awesomefreez)
#### Post date: [September 17, 2025, 5:32pm UTC](https://forum.makecode.com/t/lanterns-improving-the-multilights-extension/33190/14 "2025-09-17T17:32:16Z")

</div>

could I use it for raycast extension

---

<div class="post-metadata">

### Author: ![WoofWoof](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/woofwoof/32/32523_2.png) [@WoofWoof](https://forum.makecode.com/u/WoofWoof)
#### Post date: [September 17, 2025, 5:59pm UTC](https://forum.makecode.com/t/lanterns-improving-the-multilights-extension/33190/15 "2025-09-17T17:59:36Z")

</div>

In what way? If you are looking for a darkness effect for the raycasting extension, it won’t just work out of the box, if at all, and if it does work if would just be a halo effect applied on top of the screen, and would not be a 3D effect. Making this into a 3D effect would take heavily modifying the raycasting extension, and it would probably be extremely laggy.

---

<div class="post-metadata">

### Author: ![JtSpeedRun](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jtspeedrun/32/33167_2.png) [@JtSpeedRun](https://forum.makecode.com/u/JtSpeedRun)
#### Post date: [September 17, 2025, 10:41pm UTC](https://forum.makecode.com/t/lanterns-improving-the-multilights-extension/33190/16 "2025-09-17T22:41:01Z")

</div>

Still using this extension btw, and it’s an absolute GODSEND. I’ve already used it in Diego Curse 2, Hidden Shades, and an unrevealed game and in all of them the effects look graphicly awesome and really useful. Great extension 🔥

---

<div class="post-metadata">

### Author: ![Awesomefreez](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/awesomefreez/32/24832_2.png) [@Awesomefreez](https://forum.makecode.com/u/Awesomefreez)
#### Post date: [September 19, 2025, 7:13pm UTC](https://forum.makecode.com/t/lanterns-improving-the-multilights-extension/33190/17 "2025-09-19T19:13:16Z")

</div>

Im trying to use it as a flash light but it keeps moving

---

<div class="post-metadata">

### Author: ![WoofWoof](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/woofwoof/32/32523_2.png) [@WoofWoof](https://forum.makecode.com/u/WoofWoof)
#### Post date: [September 19, 2025, 7:25pm UTC](https://forum.makecode.com/t/lanterns-improving-the-multilights-extension/33190/18 "2025-09-19T19:25:17Z")

</div>

Uhh try attaching it to a sprite that’s “relative to screen”? That might work…?

---

<div class="post-metadata">

### Author: ![Awesomefreez](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/awesomefreez/32/24832_2.png) [@Awesomefreez](https://forum.makecode.com/u/Awesomefreez)
#### Post date: [September 22, 2025, 6:17pm UTC](https://forum.makecode.com/t/lanterns-improving-the-multilights-extension/33190/19 "2025-09-22T18:17:29Z")

</div>

im also using a modified version of the raycast extension that added floors

---

<div class="post-metadata">

### Author: ![Awesomefreez](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/awesomefreez/32/24832_2.png) [@Awesomefreez](https://forum.makecode.com/u/Awesomefreez)
#### Post date: [September 22, 2025, 6:17pm UTC](https://forum.makecode.com/t/lanterns-improving-the-multilights-extension/33190/20 "2025-09-22T18:17:32Z")

</div>

I did that but it still continues to move around the screen

[Next page](https://forum.makecode.com/t/lanterns-improving-the-multilights-extension/33190.md?page=2)
