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

#1 2012-07-29 14:43:43

coolhogs
Scratcher
Registered: 2011-07-26
Posts: 1000+

methods

I don't understand methods, but I understand blockspec.

Could someone please help?

Link me to a tutorial, explain it...

Just help me!


Get ready for domination of:  tongue

Offline

 

#2 2012-07-29 15:15:03

BirdByte
Scratcher
Registered: 2012-07-07
Posts: 1000+

Re: methods

The answer is on the wiki:
http://wiki.scratch.mit.edu/wiki/Squeak_Tutorial#Methods
smile
I've clocked Submit about 80 times. This 180 second rule lasts longer than 180 seconds. XL


http://i50.tinypic.com/312u714.jpg

Offline

 

#3 2012-07-29 15:23:15

chanmanpartyman
Scratcher
Registered: 2011-05-30
Posts: 500+

Re: methods

coolhogs wrote:

I don't understand methods, but I understand blockspec.

Could someone please help?

Link me to a tutorial, explain it...

Just help me!

Methods are what blockspecs call. For example, ('move %n steps' #- #forward:) is the move (10) steps block. I'll dissect it: () are the parentheses that keep the block held together.
('move %n steps') that indicates what is shown (for more arguments/inputs, go to Scratch-Blocks>CommandBlockMorph>private>uncoloredArgMorphFor:).
('move %n steps' #-) The #- shows what type of block is is.
('move %n steps' #- #forward:) #forward: indicates the method.
To make a method, you go to a category in a class (primary example, do not add methods to without experience) for example, initialize. I only use this because it is used in almost every class. So then an example which has no functionality is highlighted for you to write your own method. Squeak is the least needed tutorial language. Look around in the category Kernel-Methods for some simple methods that are used all of the time.

Offline

 

Board footer