Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » How do I make a working flashlight?
- 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
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?
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:

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:
when this sprite clicked3rd: you need to add this script to the light:
if <[light] = [1]> then
set [light] to [0]
else
set [light] to [1]
end
when green flag clickedand your done!
forever
if <[light] = [1]> then
show
else
hide
end
end

- deck26
-
Scratcher
1000+ posts
How do I make a working flashlight?
you need 4 sprites:Not clear how this makes the item appear when you ‘shine’ the light on it.
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:when this sprite clicked3rd: you need to add this script to the light:
if <[light] = [1]> then
set [light] to [0]
else
set [light] to [1]
endwhen green flag clickedand your done!
forever
if <[light] = [1]> then
show
else
hide
end
end
- 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.

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?
How I use when its room and your using flashlights?Please make another topic for others to reply to. This topic is from 9 months ago.![]()
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.
- 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.
- Discussion Forums
- » Help with Scripts
-
» How do I make a working flashlight?