Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Sample code for vmarie only
- Noumenon72
- Scratcher
24 posts
Sample code for vmarie only
Hey, I liked your mermaid project and wanted to see it finished, but it's been a while since you shared it and I thought maybe it was getting to be too big for you to have fun with it. I just had one suggestion to make things easier. Every time you add a room you have to go through every single sprite and say
It works fine with two backdrops like Spike Weed, but in a big project you have 20 sprites and up to five of these for every sprite. You could replace all of these with
I also made this project trying to make it easier to navigate through the caves, but it's probably overkill. The only thing I'm sure you'd find helpful is this code for making it easier to click on those skinny arrows with their transparent backgrounds.
This code does require you to have the sprite centered on the crosshairs in the paint canvas, since distance gets measured from the crosshairs.
when backdrop switches to [New backdrop]
hide
It works fine with two backdrops like Spike Weed, but in a big project you have 20 sprites and up to five of these for every sprite. You could replace all of these with
when I receive [Entered room]
if <(backdrop name) = [Underwater cave entrance]> then
show
else
hide
end
I also made this project trying to make it easier to navigate through the caves, but it's probably overkill. The only thing I'm sure you'd find helpful is this code for making it easier to click on those skinny arrows with their transparent backgrounds.
forever
if <mouse down?> then
if <(distance to [ mouse pointer]) < [20]> then
switch backdrop to [whatever]
end
end
end
This code does require you to have the sprite centered on the crosshairs in the paint canvas, since distance gets measured from the crosshairs.
Last edited by Noumenon72 (Nov. 4, 2014 05:32:38)
- Discussion Forums
- » Help with Scripts
- » Sample code for vmarie only