This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2011-05-08 20:38:40

Ralfiyell
New Scratcher
Registered: 2010-07-04
Posts: 7

Creating a Flashlight type Effect?

What  I'm trying to do is have an entirely Black screen with the only visible object being a flashlight that follows the mouse cursor.(this part I can do).

Through out the black area, there will be many different objects which you can only bee seen when the flash light is turned on and the light is shining on it.

So what I'm wondering is, How can I make the Black area disapear ONLY where the light beam from the flashlight is touching it.

In other words, is they're a way to make Graphic effects only effect certain areas of a sprite?


Any help/ideas you can give me are much appreciated.

Thanks!

Offline

 

#2 2011-05-08 20:54:41

AtomicBawm3
Scratcher
Registered: 2009-06-27
Posts: 1000+

Re: Creating a Flashlight type Effect?

Not in certain areas of a sprite, no.  You can make your flashlight sprite be the farthest back though so that anything black stands out against it.  You might also be able to do something like:

If (distance to (light))<100:
  set brightness to (distance to (light))*-1
else
  set brightness to (-100)


http://i50.tinypic.com/j0yw0p.jpg

Offline

 

#3 2011-05-08 21:37:10

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: Creating a Flashlight type Effect?

I've seen projects that incorporate this kind of effect before; let me see if I can find one.

Edit: Found one. I'm really not sure how this works, but I'm sure you could figure it out by taking a look at the scripts.

Last edited by Harakou (2011-05-08 21:38:47)


http://www.blocks.scratchr.org/API.php?action=random&amp;return=image&amp;link1=http://i.imgur.com/OZn2RD3.png&amp;link2=http://i.imgur.com/duzaGTB.png&amp;link3=http://i.imgur.com/CrDGvvZ.png&amp;link4=http://i.imgur.com/POEpQyZ.png&amp;link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

Board footer