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

#1 2010-04-09 17:00:30

midnightleopard
Scratcher
Registered: 2007-09-13
Posts: 1000+

Instance

I know how to make a block look the way I want, but I don't know how to make it work. I know it has something to do with the 'instance' tab but then what do I do? is that where I need to put small talk 80? I have found many block codes on the forums, many of which require a code to be pasted into instance. I have no idea what it is.  also would want to know how to look at the 'instance' for other blocks.


http://pwp.wizards.com/5103673563/Scorecards/Landscape.png

Offline

 

#2 2010-04-10 10:38:00

bigreader
Scratcher
Registered: 2007-08-14
Posts: 100+

Re: Instance

When you make a block, you need to do two things. First, you define the block. Then, you need to tell Scratch what it does. The block is like a word, and the instance is its definition. Without it, Scratch will not know what to do with the block.

To code an instance, you need to know either an example code, or enough Smalltalk to code it by yourself. An instance is made of either two or three parts: Title, Code, and in the case of a reporter or Boolean, a Report.

• The title is the name of the instance; for example "changeCostumeBy:".

• The code is simply what the block does to achieve its result; for example "costume _ costumeNumber + t1".

• The Report is what the block reports; for example "^t1".

The title will usually have colons (:) in it. These represent inputs in the block.
Also in most code are Variables. These are usually repesented as the letter t followed by a number.

To make a new instance, click on the "instance" tab in the browser, then click the correct category for your new code. Code will appear in the bottom section of the browser. Start typing the title of your new instance, or paste the code in and save. (I'm not going to go over Smalltalk here, since I couldn't program in it if my life depended on it, but you may be able to Google some tutorials if you don't know some already.) After you code the instance, save it and head over to class. You can now make a block and code it with your instance, save, and use to your heart's content!

For more about coding in Smalltalk and Squeak, the Advanced Topics Forums are home to dozens of block coding topics. Have fun, and Scratch On!

Last edited by bigreader (2010-04-10 10:39:55)


I'm currently taking a break from Scratch.
Zing - now even easier to install!

Offline

 

#3 2010-04-10 11:03:26

midnightleopard
Scratcher
Registered: 2007-09-13
Posts: 1000+

Re: Instance

bigreader wrote:

When you make a block, you need to do two things. First, you define the block. Then, you need to tell Scratch what it does. The block is like a word, and the instance is its definition. Without it, Scratch will not know what to do with the block.

To code an instance, you need to know either an example code, or enough Smalltalk to code it by yourself. An instance is made of either two or three parts: Title, Code, and in the case of a reporter or Boolean, a Report.

• The title is the name of the instance; for example "changeCostumeBy:".

• The code is simply what the block does to achieve its result; for example "costume _ costumeNumber + t1".

• The Report is what the block reports; for example "^t1".

The title will usually have colons ( smile  in it. These represent inputs in the block.
Also in most code are Variables. These are usually repesented as the letter t followed by a number.

To make a new instance, click on the "instance" tab in the browser, then click the correct category for your new code. Code will appear in the bottom section of the browser. Start typing the title of your new instance, or paste the code in and save. (I'm not going to go over Smalltalk here, since I couldn't program in it if my life depended on it, but you may be able to Google some tutorials if you don't know some already.) After you code the instance, save it and head over to class. You can now make a block and code it with your instance, save, and use to your heart's content!

For more about coding in Smalltalk and Squeak, the Advanced Topics Forums are home to dozens of block coding topics. Have fun, and Scratch On!

wow thanks that was very helpful!


http://pwp.wizards.com/5103673563/Scorecards/Landscape.png

Offline

 

#4 2011-02-13 15:21:54

TVflea
Scratcher
Registered: 2010-08-14
Posts: 1000+

Re: Instance

oldest viewable forum.awsome


-iNetMaster-'s not dead, get used to it. ! big_smile .
http://is.gd/YrQzXX

Offline

 

#5 2011-02-13 18:38:19

midnightleopard
Scratcher
Registered: 2007-09-13
Posts: 1000+

Re: Instance

necropost


http://pwp.wizards.com/5103673563/Scorecards/Landscape.png

Offline

 

Board footer