Discuss Scratch

jonny0514
Scratcher
4 posts

How do I make a working flashlight?

I want to make a 1st person flashlight, thats essentially a perfect circle that reveals whats behind a pitch black sprite. I know theres the trick where you have a pitch black sprite with a see-through circle in the middle, but that has a lot of downsides and I'd rather try the former solution. Is there any way to do this?
gor-dee
Scratcher
1000+ posts

How do I make a working flashlight?

I think you are best using the “pitch black sprite with a see-through circle in the middle”.
To see through a pitch black sprite you could use ghost effect but that effects the whole sprite, or…
you could make a black background and have a white circle sprite and change objects ghost effect depending on the distance from the (center of the) circle but I don't think this would look good unless the objects were small
deck26
Scratcher
1000+ posts

How do I make a working flashlight?

How would it work? How can a sprite make one area of a screen lighter but not affect the rest of the screen? Making an area darker is easy so the ‘hole in the middle’ method is much easier to implement.
gor-dee
Scratcher
1000+ posts

How do I make a working flashlight?

I made a demo project here https://scratch.mit.edu/projects/284085216/ and it looks quite good! But if the objects were larger…probably not.
deck26
Scratcher
1000+ posts

How do I make a working flashlight?

gor-dee wrote:

I made a demo project here https://scratch.mit.edu/projects/284085216/ and it looks quite good! But if the objects were larger…probably not.
Nice workaround. Probably of limited use in most circumstances but an inventive solution.
wigglebug09
Scratcher
42 posts

How do I make a working flashlight?

you need 4 sprites:

the flashlight
the button
the light
the thing that you want to see

1st: you need to make the background black (and the thing that you want to see)
2nd: add this script to the button:
whenthisspriteclickediflight=1thensetlightto0elsesetlightto1
3rd: you need to add this script to the light:
whenclickedforeveriflight=1thenshowelsehide
and your done!
deck26
Scratcher
1000+ posts

How do I make a working flashlight?

wigglebug09 wrote:

you need 4 sprites:

the flashlight
the button
the light
the thing that you want to see

1st: you need to make the background black (and the thing that you want to see)
2nd: add this script to the button:
whenthisspriteclickediflight=1thensetlightto0elsesetlightto1
3rd: you need to add this script to the light:
whenclickedforeveriflight=1thenshowelsehide
and your done!
Not clear how this makes the item appear when you ‘shine’ the light on it.
jarlskiejarl15
Scratcher
21 posts

How do I make a working flashlight?

How I use when its room and your using flashlights?
Ps: I making a The Dark Light in Scratch.
Pss. It when it click, you seen the room but not all the rooms (backgrounds).
Another Pss: when it click show, when it click again hide.

Last edited by jarlskiejarl15 (Jan. 14, 2020 05:48:58)

ramenosu
Scratcher
55 posts

How do I make a working flashlight?

jarlskiejarl15 wrote:

How I use when its room and your using flashlights?
Ps: I making a The Dark Light in Scratch.
Pss. It when it click, you seen the room but not all the rooms (backgrounds).
Another Pss: when it click show, when it click again hide.
Please make another topic for others to reply to. This topic is from 9 months ago.
jarlskiejarl15
Scratcher
21 posts

How do I make a working flashlight?

Yeah thnx.
funkybagels3000
Scratcher
2 posts

How do I make a working flashlight?

how would i make a flash light in a top down game were my sprite is holding the flashlight? p.s. i am secretly a species of bagel named the funkybagel that was hidden by government i am a bagel with wings.

Powered by DjangoBB