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

#1 2008-06-18 20:56:14

fullmoon
Retired Community Moderator
Registered: 2007-06-04
Posts: 1000+

ITopic: Little-Known Scratch Tips

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)


http://i302.photobucket.com/albums/nn100/fullmoon32/wow.jpg

Offline

 

#2 2008-06-18 21:29:56

funkymonkey
Scratcher
Registered: 2007-06-03
Posts: 1000+

Re: ITopic: Little-Known Scratch Tips

cool


http://i243.photobucket.com/albums/ff67/hprules_photos/banner2.jpg
Kuzimu: Dawn of a New Age                                                                                                  Coming May 2010

Offline

 

#3 2008-06-18 21:54:28

DrSuper
Scratcher
Registered: 2008-06-10
Posts: 37

Re: ITopic: Little-Known Scratch Tips

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

 

#4 2008-06-19 18:11:00

fullmoon
Retired Community Moderator
Registered: 2007-06-04
Posts: 1000+

Re: ITopic: Little-Known Scratch Tips

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.


http://i302.photobucket.com/albums/nn100/fullmoon32/wow.jpg

Offline

 

#5 2008-06-19 19:57:20

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: ITopic: Little-Known Scratch Tips

Nice! GREAT tips! I didn't know you could boolean a say!

Offline

 

#6 2008-06-23 13:33:33

s_federici
Scratcher
Registered: 2007-12-18
Posts: 500+

Re: ITopic: Little-Known Scratch Tips

Thanks for sharing your tips. They are really precious, I'm sure.

Offline

 

#7 2008-06-24 01:46:41

JSO
Community Moderator
Registered: 2007-06-23
Posts: 1000+

Re: ITopic: Little-Known Scratch Tips

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


http://oi48.tinypic.com/2v1q0e9.jpg

Offline

 

#8 2008-06-24 10:57:43

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: ITopic: Little-Known Scratch Tips

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.


http://i39.tinypic.com/2nav6o7.gif

Offline

 

#9 2008-06-24 11:03:58

Cyclone103
Scratcher
Registered: 2008-03-20
Posts: 500+

Re: ITopic: Little-Known Scratch Tips

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...

Joren

I 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.....


All your base are belong to us

Offline

 

#10 2008-06-24 16:18:22

fullmoon
Retired Community Moderator
Registered: 2007-06-04
Posts: 1000+

Re: ITopic: Little-Known Scratch Tips

Cyclone103 wrote:

Paddle2See wrote:

JSO wrote:


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.

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.


http://i302.photobucket.com/albums/nn100/fullmoon32/wow.jpg

Offline

 

#11 2008-06-24 16:20:39

Bluestribute
Scratcher
Registered: 2008-01-24
Posts: 1000+

Re: ITopic: Little-Known Scratch Tips

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


http://img247.imageshack.us/img247/1204/bluestributett4.jpg
That's my PSN ID. I know tons of COD4 glitches. Add me as your friend. Oh, and get a headset

Offline

 

#12 2008-06-24 21:20:11

DrSuper
Scratcher
Registered: 2008-06-10
Posts: 37

Re: ITopic: Little-Known Scratch Tips

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

 

#13 2008-06-25 17:02:16

Bluestribute
Scratcher
Registered: 2008-01-24
Posts: 1000+

Re: ITopic: Little-Known Scratch Tips

And dragging local variables into other sprites makes a new local variable (if it's not up there)


http://img247.imageshack.us/img247/1204/bluestributett4.jpg
That's my PSN ID. I know tons of COD4 glitches. Add me as your friend. Oh, and get a headset

Offline

 

#14 2008-06-25 17:33:08

Cyclone103
Scratcher
Registered: 2008-03-20
Posts: 500+

Re: ITopic: Little-Known Scratch Tips

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.


All your base are belong to us

Offline

 

#15 2008-06-25 17:34:09

Cyclone103
Scratcher
Registered: 2008-03-20
Posts: 500+

Re: ITopic: Little-Known Scratch Tips

And, if you drag motion onto the stage, you get script error. yay error!!!!!!!!!!!!


All your base are belong to us

Offline

 

#16 2008-07-01 16:31:07

DrSuper
Scratcher
Registered: 2008-06-10
Posts: 37

Re: ITopic: Little-Known Scratch Tips

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

 

#17 2008-07-01 17:20:55

DrSuper
Scratcher
Registered: 2008-06-10
Posts: 37

Re: ITopic: Little-Known Scratch Tips

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

 

#18 2008-07-05 15:40:29

DrSuper
Scratcher
Registered: 2008-06-10
Posts: 37

Re: ITopic: Little-Known Scratch Tips

Fullmoon et all
I just posted my first game try to beat Dr. Super;>  and pass on the word if you like it.
http://scratch.mit.edu/projects/DrSuper/206349

Offline

 

#19 2008-08-24 13:18:34

PetertheGeek
Scratcher
Registered: 2008-07-21
Posts: 34

Re: ITopic: Little-Known Scratch Tips

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)


Check out my Scratch Blog or my new game Tunnel!

Offline

 

#20 2008-08-27 13:06:59

fullmoon
Retired Community Moderator
Registered: 2007-06-04
Posts: 1000+

Re: ITopic: Little-Known Scratch Tips

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.


http://i302.photobucket.com/albums/nn100/fullmoon32/wow.jpg

Offline

 

#21 2008-08-28 18:08:20

mletreat
Scratcher
Registered: 2008-05-01
Posts: 100+

Re: ITopic: Little-Known Scratch Tips

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

 

#22 2008-08-30 07:45:29

bigB
Scratcher
Registered: 2007-06-09
Posts: 100+

Re: ITopic: Little-Known Scratch Tips

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.


http://scratch.mit.edu/projects/bigB/260981 Draw to Text
http://scratch.mit.edu/projects/bigB/181829 3D Stunt Flyer

Offline

 

#23 2008-09-10 17:05:28

PetertheGeek
Scratcher
Registered: 2008-07-21
Posts: 34

Re: ITopic: Little-Known Scratch Tips

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)


Check out my Scratch Blog or my new game Tunnel!

Offline

 

#24 2008-09-12 23:27:12

neksus
Scratcher
Registered: 2008-09-11
Posts: 2

Re: ITopic: Little-Known Scratch Tips

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!

Offline

 

#25 2008-09-13 23:15:16

fullmoon
Retired Community Moderator
Registered: 2007-06-04
Posts: 1000+

Re: ITopic: Little-Known Scratch Tips

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.


http://i302.photobucket.com/albums/nn100/fullmoon32/wow.jpg

Offline

 

Board footer