I think I'll make this into a project someday, but I thought I'd share some of the fruits of my Scratch addiction with the world. Here are some tips that I'm sure very few people know of; I found one of them today!
Quick Local>Global Variable Switch:
NOTE: Global variables are "for all sprites" and local (or private) variables are "for this sprite only" (using the phrases from the "make a variable" dialog).
Ever spend three hours on a project, making some single sprite use global variables, then decide that you want to add more sprites, but they all have to have their own? Sorry, can't help with that. However, you CAN go in the other direction. If you have a local variable you want to make global, just drag the scripts that contains blocks that deal with the locals you want to make global onto the Stage. It'll automatically create globals of the same name.
Say <Boolean> for 2 seconds
It's possible to put a boolean (triangle-cornered) block into "say" or "think" blocks. The sprite will say either "true" or "false".
One-Dimensional Dragging
For whatever reason, blocks seem to override the lock/unlock feature that lets you drag sprites. This means that if you want something to only be draggable up and down, just put code like this on the sprite and "unlock" it:
When Flag Clicked:
Forever:
Set x to 168
End Forever
Voodoo Fix for Sound Issue
On my admittedly ancient computer, Scratch often speeds up my sounds just for the heck of it. This really ticks me off. Today, while trying to fix Scratch and my microphone at the same time, I found that opening Sound Recorder in Windows, recording sounds for a few seconds, then closing it without saving causes Scratch to play sounds at normal speed (for a while, at least).
The Lost Video Support
In Scratch 1.0.1 (download here), you can shift-click on Extras to enable some experimental blocks in Sensing and Sound. They don't do anything, but the're fun to ponder.
I'll put any more on as I find them. Thanks for reading!
Last edited by fullmoon (2009-11-15 20:57:09)

Offline
cool

Offline
Thanks for sharing. I did not know about lock/unlock ;=< I am new to Scratch and reinvented it as follows (It may come in handy if you want a locked sprite that you can drag under certain conditions)
in a forever loop set x and y of the selected sprite to the x and y of the mouse
Inside this loop it keep the equality as long and the mouse is pressed (the sprite is getting dragged) as soon as the mouse is released stop the script.
One question for you. Do you know how we can get the shadow that sprites have in design at run time when they are selected?
Offline
DrSuper wrote:
In a forever loop set x and y of the selected sprite to the x and y of the mouse
Inside this loop it keep the equality as long and the mouse is pressed (the sprite is getting dragged) as soon as the mouse is released stop the script.
Yeah, that's the basic way to do it. But you'll notice that the sprite "jumps" to the mouse pointer rather than being offset and moving relatively with the mouse. Try comparing the two sometime!
DrSuper wrote:
One question for you. Do you know how we can get the shadow that sprites have in design at run time when they are selected?
The shadow you get when dragging them? No, I don't think that's possible. You could make a copy of the sprite, crank its brightness down to -100, and add code like this:
On the original sprite (we'll call it Cat):
When flag clicked:
Forever:
If <<touching mouse pointer?> and <mouse down?>>
set myDragged to 1 (this is a variable for "this sprite only"
Else:
set myDragged to 0
On the shadow:
When flag clicked:
Forever:
If <(myDragged of Cat)=1>
Show
Go to x: (x pos of Cat)-10 y: (y pos of Cat)-10
Else
Hide
The shadow is Scratch's way of reminding you that just because a sprite is draggable in edit mode doesn't mean it'll work in presentation or online.

Offline
Thanks for sharing your tips. They are really precious, I'm sure.
Offline
fullmoon wrote:
Say <Boolean> for 2 seconds
It's possible to put a boolean (triangle-cornered) block into "say" or "think" blocks. The sprite will say either "true" or "false".
Boolean block?
Where can I find it?
I tried with a variable 0 or 1...
Joren
Offline
JSO wrote:
fullmoon wrote:
Say <Boolean> for 2 seconds
It's possible to put a boolean (triangle-cornered) block into "say" or "think" blocks. The sprite will say either "true" or "false".Boolean block?
Where can I find it?
I tried with a variable 0 or 1...
Joren
I think fullmoon is refering to a block that returns a boolean value, such as "Touching Color", "Key Pressed", and so on.
Offline
Paddle2See wrote:
JSO wrote:
fullmoon wrote:
Say <Boolean> for 2 seconds
It's possible to put a boolean (triangle-cornered) block into "say" or "think" blocks. The sprite will say either "true" or "false".Boolean block?
Where can I find it?
I tried with a variable 0 or 1...
JorenI think fullmoon is refering to a block that returns a boolean value, such as "Touching Color", "Key Pressed", and so on.
Mouse down is another block that returns a boolean value. Although, I see no reason for a sprite to say if the mouse button is clicked.....
Offline
Cyclone103 wrote:
Paddle2See wrote:
JSO wrote:
Boolean block?
Where can I find it?
I tried with a variable 0 or 1...
JorenI think fullmoon is refering to a block that returns a boolean value, such as "Touching Color", "Key Pressed", and so on.
Mouse down is another block that returns a boolean value. Although, I see no reason for a sprite to say if the mouse button is clicked.....
Yeah, it's not really that useful...actually, it was probably an accident.

Offline
Wow, I never knew the boolean. That's sick!

Offline
Thanks fullmoon. I will try out your suggestion on shadow and mouse movement. With unlocking I could not get what I needed to be able to drop the sprite exactly on another sprite if it is touching it. Probably inexperience for now. I have been feverishly completing my game to post it this week;=>
Offline
And dragging local variables into other sprites makes a new local variable (if it's not up there)

Offline
Bluestribute wrote:
And dragging local variables into other sprites makes a new local variable (if it's not up there)
That one I knew. I tried that for myself! If you drag "if sprite one clicked" from control onto another sprite, it adapts.
Offline
And, if you drag motion onto the stage, you get script error. yay error!!!!!!!!!!!!
Offline
I have tried unlocking sprites and moving them I have the following issues:
1. I need a way to dynamically lock or unlock a sprite.
2. A locked sprite considers mouse down as a click but for an unlocked sprite "clicked" means the mouse has been pressed and has come up in a short (?) time interval. If I just drag an unlocked sprite it is not considered "clicked" and the scripts will not start firing until you actually click the sprite. Do you know a way around this. I really need a mouse down event for unlocked sprites;=<
Regards
Dr. Super
Offline
I just read your first post again and saw the answer (that you had given.) As I need only my sprite to be locked when it has a particular costume I wrote
When Flag Clicked:
Forever:
If costume = c
Set x to 168
Set Y to 100
End Forever
And it works Thanks;=> Now I have to change all the code in my application so that the sprites would not jump when they are clicked;=<>
Offline
Good tips! I really like the boolean one. I knew you could do it, but I thought it would just bring up an error.
Also, I don't know whether you want to include these, but here they are.
1) You can right click the script area and click "Clean Up" and it will put all of the scripts in one nice, neat column.
2) You can right click the script area and click "Save Picture of Scripts" and then select a destination for the image to save to.
3) You can right click the stage and click "Grab Screen Region for New Sprite" and then select any region in the Scratch program and it will turn it into a new sprite. This is good for making tutorials if you want a picture of the scripts you used.
4) You can right click the stage and click "Save Picture of Stage" and select a destination for the image to save to.
5) You can hold the shift key while increasing or decreasing a sprite's size to make it increase/decrease in large increments.
Last edited by PetertheGeek (2008-09-10 17:04:10)
Offline
PetertheGeek wrote:
Good tips! I really like the boolean one. I knew you could do it, but I thought it would just bring up an error.
Also, I don't know whether you want to include these, but here they are.
1) You can right click the script area and click "Clean Up" and it will put all of the scripts in one nice neat column.
2) You can right click the script area and click "Save Picture of Scripts" and then select a destination for the image to save to.
3) You can right click the stage and click "Grab Screen Region for New Sprite" and then select any region in the Scratch program and it will turn it into a new sprite.
4) You can right click the stage and click "Save Picture of Stage" and select a destination for the image to save to.
5) You can hold the shift key while encreasing or decreasing a sprite's size to make it increase/decrease in large increments.
Cool! I didn't know about the shift key one.

Offline
PetertheGeek wrote:
Good tips! I really like the boolean one. I knew you could do it, but I thought it would just bring up an error.
Also, I don't know whether you want to include these, but here they are.
1) You can right click the script area and click "Clean Up" and it will put all of the scripts in one nice neat column.
2) You can right click the script area and click "Save Picture of Scripts" and then select a destination for the image to save to.
3) You can right click the stage and click "Grab Screen Region for New Sprite" and then select any region in the Scratch program and it will turn it into a new sprite.
4) You can right click the stage and click "Save Picture of Stage" and select a destination for the image to save to.
5) You can hold the shift key while encreasing or decreasing a sprite's size to make it increase/decrease in large increments.
These are good tips...I am going to post a link to this post in the Welcome New Users forum - thanks for sharing!
Offline
I dont know if this tip has already been mentioned somewhere on the forums but i'll mention it anyway.
If you have a project with lots of forever loops that is running slowly on or off the internet you can make it run better by coppying everything in the loop two or three times and adding a small wait of maybe 0.01 seconds. this should help it run on slower computers.
for example instead of:
forever,
move 1 step
you could do:
forever,
move 1 step
move 1 step
move 1 step
wait 0.01 seconds.
Offline
fullmoon wrote:
Cool! I didn't know about the shift key one.
Thanks! My Scratch teacher actually told me about the shift key one.
Last edited by PetertheGeek (2008-09-16 09:08:03)
Offline
neksus wrote:
Use variables for numbers you use more than 2-3 times.
Then, if you're testing or want to change something, you only need to change the variable and not all 50 instances of the number!
Good point; many of us have learned this the hard way.

Offline