First, you make 5 sprites, 4 are just black boxes that fill the screen and the remaining one is a black box with a hole in the size of your torch.
second, add this script to the boxes
when gf clicked //black box 1 forever go to x:(([x position v] of [player v]) + (50)) y:([y position v] of [player v]) end when gf clicked //black box 2 forever go to x:(([x position v] of [player v]) - (50)) y:([y position v] of [player v]) end when gf clicked //black box 3 forever go to x:([x position v] of [player v]) y:(([y position v] of [player v]) + (50)) end when gf clicked //black box 4 forever go to x:([x position v] of [player v]) y:(([y position v] of [player v]) - (50)) end //the numbers will need changingFor the last one, the one with the hole, make it always go to the player
Offline
Interesting problem.. I have one (currently untested) solution.
Create yourself a LARGE 100% black rectangle, that matches the dimension of the scratch canvas. This allows it to scroll significantly off-screen. Cut (with your favourite image editor; I recommend GIMP or Paint.Net) a round hole and set it's fill to 100% transparent. Possibly add a little blur to the edges, save this as a PNG.
On the canvas, add your regular background, and then overlay the sprite you created above. Add some mouse controls and you should be in business!
I've (quickly) hacked together an example of the concept.. it 'mostly' works. You'll need to add some logic to cover exposed borders with black too.
Added bonus, setting the ghost effect makes the darkness.. not quite darkness. It's an interesting effect.. anyway, example here :
http://scratch.mit.edu/projects/plemon11/2739578
Kind Regards,
PL
Offline
plemon11 wrote:
Interesting problem.. I have one (currently untested) solution.
Create yourself a LARGE 100% black rectangle, that matches the dimension of the scratch canvas. This allows it to scroll significantly off-screen. Cut (with your favourite image editor; I recommend GIMP or Paint.Net) a round hole and set it's fill to 100% transparent. Possibly add a little blur to the edges, save this as a PNG.
On the canvas, add your regular background, and then overlay the sprite you created above. Add some mouse controls and you should be in business!
I've (quickly) hacked together an example of the concept.. it 'mostly' works. You'll need to add some logic to cover exposed borders with black too.
Added bonus, setting the ghost effect makes the darkness.. not quite darkness. It's an interesting effect.. anyway, example here :
http://scratch.mit.edu/projects/plemon11/2739578
Kind Regards,
PL
You cannot blur because Scratch doesn't support semi-transparency.
Offline
You cannot blur because Scratch doesn't support semi-transparency.
Many thanks! This is indeed correct. In which case, you can make this sprite with the built in sprite editor, just select transparent and draw yourself something mostly torch shaped!
The example now uses exactly this technique (because it looks better!)
PL
Offline