Discuss Scratch

-Arc-Reactor-
Scratcher
6 posts

How to make a Flashlight?

I want to make a flashlight similar to the one in FNAF 2, but how?
RT_Borg
Scratcher
1000+ posts

How to make a Flashlight?

Hi -Arc-Reactor-,

I'm not familiar with FNAF 2, but I think I know the flashlight effect you're asking about.

The idea is to use an image with a transparent circle in the middle, and a background color (probably black) around the transparent circle. The scratch costume editor can't make images with transparency, so it has to be made in another painting program and loaded into scratch. Or you could find a costume in a game that already has the effect, and use that.

If there are other sprites on layers below the sprite with the “flashlight” costume, you'll only see things where the transparent circle is. The rest is covered by the background colored part of the flashlight image.

– RT_Borg
RT_Borg
Scratcher
1000+ posts

How to make a Flashlight?

Here's a quick demo I put together. I'm sure you can find or make a better flashlight image than I drew.

Demo: Flashlight
https://scratch.mit.edu/projects/719557276

– RT_Borg
Adam-basha_tutorial
Scratcher
37 posts

How to make a Flashlight?

-Arc-Reactor- wrote:

I want to make a flashlight similar to the one in FNAF 2, but how?
Hello
If you want to make a flashlight. first thing you need is two pictures of a flashlight (one is on, o=another is off)then choose a cool button and write on off and on.
Then rename the buttons 1 and the other is 2.
Then start coding this code
Buttons:
whenthisspriteclickednextcostumesetFlashtocostume#
Flash
whenclickedforeverswitchcostumeto(Flash)
I hope it worked
cIoudyness
Scratcher
500+ posts

How to make a Flashlight?

RT_Borg wrote:

Hi -Arc-Reactor-,

I'm not familiar with FNAF 2, but I think I know the flashlight effect you're asking about.

The idea is to use an image with a transparent circle in the middle, and a background color (probably black) around the transparent circle. The scratch costume editor can't make images with transparency, so it has to be made in another painting program and loaded into scratch. Or you could find a costume in a game that already has the effect, and use that.

If there are other sprites on layers below the sprite with the “flashlight” costume, you'll only see things where the transparent circle is. The rest is covered by the background colored part of the flashlight image.

– RT_Borg
I’m pretty sure if you used the eraser tool in the vector editor you could get a similar effect.
best option for this is probably to draw a bitmap circle in some nonobtrusive color - perhaps a grey - and then fill that circle with “no fill”. sometimes bitmap is odd and some little pixels are left behind on the edges so using a grey is a good idea.
SpaceExplorerPro
Scratcher
100+ posts

How to make a Flashlight?

RT_Borg wrote:

Here's a quick demo I put together. I'm sure you can find or make a better flashlight image than I drew.

Demo: Flashlight
https://scratch.mit.edu/projects/719557276

– RT_Borg


If you want it to be more smooth try this:https://scratch.mit.edu/projects/719575423/
RT_Borg
Scratcher
1000+ posts

How to make a Flashlight?

Hi SpaceExplorerPro

Very nice! Thanks for sharing your improvement. It looks so much better with the semi-transparent penumbra around the transparent center.

I'll delete my rushed demo after this topic drops off the front page. I saved a link to your project, in case I see someone else ask about flashlights in Help.

– RT_Borg
UnofficialHelpGuy
Scratcher
11 posts

How to make a Flashlight?

I have a Flashlight System that may be useful for this
https://scratch.mit.edu/projects/663417089/
RT_Borg
Scratcher
1000+ posts

How to make a Flashlight?

Also very nice!

I bow down to the artistic prowess of @SpaceExplorerPro and @UnofficialHelpGuy

– RT_Borg
Robot_177
Scratcher
44 posts

How to make a Flashlight?

whenclickedforevergotomouse-pointer

babablacksheep_woody
Scratcher
14 posts

How to make a Flashlight?

please give credit if using!
-Arc-Reactor-
Scratcher
6 posts

How to make a Flashlight?

You guys are awesome, thank you for all the responses!
-Arc-Reactor-
Scratcher
6 posts

How to make a Flashlight?

RT_Borg wrote:

Hi -Arc-Reactor

I'm not familiar with FNAF 2, but I think I know the flashlight effect you're asking about.

Basically in FNAF 2 you can shine your flashlight into the hallway to scare off Foxy, and you can shine it on the cameras too.
cIoudyness
Scratcher
500+ posts

How to make a Flashlight?

-Arc-Reactor- wrote:

RT_Borg wrote:

Hi -Arc-Reactor

I'm not familiar with FNAF 2, but I think I know the flashlight effect you're asking about.

Basically in FNAF 2 you can shine your flashlight into the hallway to scare off Foxy, and you can shine it on the cameras too.
maybe you can have a second sprite for a “flashlight hitbox” or something that if foxy isn’t touching then he gets scared and runs off
-Arc-Reactor-
Scratcher
6 posts

How to make a Flashlight?

I haven’t tried any of these ideas yet as I have no internet currently (am using a phone right now), but I will try them when my internet returns. Thank you guys very much for these responses.
-Arc-Reactor-
Scratcher
6 posts

How to make a Flashlight?

-Arc-Reactor- wrote:

I haven’t tried any of these ideas yet as I have no internet currently (am using a phone right now), but I will try them when my internet returns. Thank you guys very much for these responses.
with this i saw his signature and thought it was part of the message, my bad
-Arc-Reactor-
Scratcher
6 posts

How to make a Flashlight?

cIoudyness wrote:

-Arc-Reactor- wrote:

RT_Borg wrote:

Hi -Arc-Reactor

I'm not familiar with FNAF 2, but I think I know the flashlight effect you're asking about.

Basically in FNAF 2 you can shine your flashlight into the hallway to scare off Foxy, and you can shine it on the cameras too.
maybe you can have a second sprite for a “flashlight hitbox” or something that if foxy isn’t touching then he gets scared and runs off
How would I make the flashlight stay within the borders of the hitbox though?
SpaceExplorerPro
Scratcher
100+ posts

How to make a Flashlight?

RT_Borg wrote:

Hi SpaceExplorerPro

Very nice! Thanks for sharing your improvement. It looks so much better with the semi-transparent penumbra around the transparent center.

I'll delete my rushed demo after this topic drops off the front page. I saved a link to your project, in case I see someone else ask about flashlights in Help.

– RT_Borg
Thank you.
cIoudyness
Scratcher
500+ posts

How to make a Flashlight?

the simplest way I can think of is to have two basically duplicate sprites of the flashlight, but one missing the vignette so it’s a harsh circle. then one of them can just always go to the other sprite.

Powered by DjangoBB