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

#1 2009-10-29 04:05:32

WeirdF
Scratcher
Registered: 2009-05-31
Posts: 1000+

Scratch Code Tutorial

Hello, and welcome to the Scratch Code Tutorial. First of all, you need to have it open. Download it or you will not be able to complete the tutorial. Press the green flag and lets begin.

Okay, you will see a list, and the Scratch cat on the screen in front of you. The cat is at 0 x  0 y. First of all, lets make him move. Type this in:

Code:

move.10

and press enter. Remember to press enter between every line. Now, to run through your script, type in 'go' and press enter. What will happen now is your command will be transferred to a second, invisible list, and processed. Assuming you have typed in the correct thing, the cat will move 10 steps.

Now, lets add a second line of script. Type in

Code:

move.-20

Now run through the  scripts and the cat should end up where he started. Then type in 'clear' an press enter.

Now lets look at effects. Type in this, remember to press enter between each line:

Code:

colour.10
whirl.10
fisheye.10

Now run through your scripts. Since you have downloaded it, you can now edit the script. If you are in presentation view, leave it. Now click on the line of the script that says 'colour.10', and change the 10 to a 20. Now do this for all the lines and run the script through again.

Now you've learnt how to edit your script and do some effects. These are the other effects:

Code:

bright.[value]    Brightness
pixel.[value]      Pixelate
mosaic.[value]     Mosaic
ghost.[value]     Ghost

Now add another line to the program, type in:

Code:

clear graphic effects

Run through the scripts. I'm sure you can guess what will happen.

Right, now lets play around with the pen. Clear it then type this in:

Code:

pen down
pen.50
move.10
point.0
move.10
pen up
point.90
move.10
pen down
pensize.20
move.10
clear pen
stamp
move.10
stamp
move.10
clear pen

Now run through your scripts.

We've learnt a few new commands.

Code:

pen.[value]        Sets pen colour
pensize.[value]        Sets pen size
pen down -  start using the pen
pen up - stop using the pen
stamp - stamps the Scratch cat
clear pen - clears the pen on the screen
point.[value]        Point in a direction

Now, lets have a look at some new bits of code. Type in clear and then type this in:

Code:

x.20
y.20
ask.What's your name?
say.That's a nice name
think.That's a rubbish name
size.80
size.60
size.40
size.20
size.0
size.100
hide
wait.1
show
x.0
y.0

That's a script full of completely new commands. It's obvious what they do, but I'll explain anyway:

Code:

x.[value]        Set x position
y.[value]        Set y position
ask.[question]        Use Scratch's ask function
say.[something]        Say something
think.[something]        Think something
size.[value]        Set size
wait.[value]        Wait a certain amount of seconds
hide - hide
show - show

Now, lets just do one more thing and then you're done, clear it first:

Code:

move.10
next costume
move.10
next costume
move.10
next costume
move.10
next costume

Run through the script.

Right, we've learnt all the commands in Scratch Code. Now just play around with them.

Check back here for updates on Scratch Code, and most importantly, Scratch Off, no, sorry, Scratch On (or off if you want to)!

Last edited by WeirdF (2009-10-29 04:07:57)


http://i.cr3ation.co.uk/dl/s1/gif/847032b8a331def77529b6a0384db1fe_handfingers.gif

Offline

 

#2 2009-10-29 05:15:43

Ralphjos
Scratcher
Registered: 2009-10-10
Posts: 100+

Re: Scratch Code Tutorial

I give props to you WeirdF, your project Scratch Code is very intresting...

    Regards,
       Ralphj
os

Last edited by Ralphjos (2009-10-29 05:16:16)


http://i33.tinypic.com/2dt3j9j.gif

Offline

 

#3 2009-10-29 06:13:16

WeirdF
Scratcher
Registered: 2009-05-31
Posts: 1000+

Re: Scratch Code Tutorial

Well, as usual, only one person has actually bothered to reply to this. *Sigh*


http://i.cr3ation.co.uk/dl/s1/gif/847032b8a331def77529b6a0384db1fe_handfingers.gif

Offline

 

#4 2009-10-30 18:38:50

fg123
Scratcher
Registered: 2008-11-13
Posts: 1000+

Re: Scratch Code Tutorial

Hmm... I like it! People have made things similar to this. Like the S programming language. Anyways, I think you did a great job. It must have been hard.


Hai.

Offline

 

#5 2009-11-08 08:42:20

pizza92
Scratcher
Registered: 2008-12-17
Posts: 1

Re: Scratch Code Tutorial

so, where is the obsolete thing?

Offline

 

#6 2009-11-08 10:53:50

WeirdF
Scratcher
Registered: 2009-05-31
Posts: 1000+

Re: Scratch Code Tutorial

pizza92 wrote:

so, where is the obsolete thing?

What do you mean, where the project is? The link is at the top of the page, but here's another one: http://scratch.mit.edu/projects/WeirdF/737081


http://i.cr3ation.co.uk/dl/s1/gif/847032b8a331def77529b6a0384db1fe_handfingers.gif

Offline

 

Board footer