
The tutorial were everyone contributes.



Hello, and welcome to Tutorials-R-Us. Tutorials-R-Us is a user-created manual on how to program in Scratch and in Squeak. Users are able to post their own tutorials in this thread to be added, just like the Block Library. This way, users can pool together all their resources to make a giant Scratch-How-To book!!
User Contributions
ProgrammingFreak: 1 GP1:1
Helpers Pecola1 Admin/Mod/Developer
Hello12345678910 Admin/Mod/Developer
Scimonster Wiki Manager/Developer
Tutorials-R-Us. Shared Account
Want to be added? Just ask us!!
Last edited by Tutorials-R-Us (2011-08-02 11:14:55)
Offline



Post your name, title of tutorial, and type of tutorial [Squeak/Scratch].
Write your tutorial. Be sure to include these BBCode tags at the bottom of your post.
[url=http://scratch.mit.edu/forums/viewtopic.php?pid=801105#p801105][img]http://i.imgur.com/A6ZBV.gif[/img][/url]
[url=http://scratch.mit.edu/forums/viewtopic.php?pid=806951#p806951][img]http://i.imgur.com/Ux7pX.gif[/img][/url]
Which makes: 

Wait until we add it [the more helpers we have, the better].
Is your tutorial taking to long? check the Queue to see if we've noticed it.
You can also post Links to already created tutorials and we will add them to the Links section.
Last edited by Tutorials-R-Us (2011-07-30 17:27:31)
Offline
Offline
Offline


Here are the absolute basics that you need to know in order to use anything dealing with Squeak. Remember, if you feel something is missing just tell us and we will add it for you!
Hello! So since you are visiting this page, I assume that you have been courageous enough to learn the amazing language of SmallTalk. You probably know this language as Squeak.
Well, you can call them either.
Download
So, before we start, you need to figure out what you are going to use to test the code in these tutorials.
Here are your options:
[+] You can download the Squeak program and use it. This is the thing that Scratch was made in.
[+] You can download the source of the Scratch program. I recommend that you use this when making a modification.
[+] If you haven't already, you can just download the normal scratch.
Browser
Now, even though you have finished downloading, you still need to get to the browser. [+]The Browser is a whole system that holds all the code for the program/morph.
This is where you will do your main coding.
Now of course, since I have listed down multiple programs to use in this tutorial, there are multiple ways to get to the Browser.
• For Squeak: This is really easy, because, all you have to do is right click the gray area. A menu called 'World' should pop-up. Then click the option 'Open...'. Then click 'Browser'.
• For the Source: Click the 'File' menu while clicking Shift. Then click the option 'Exit User Mode'. A gray area surrounds the bottom and right side. Right click the gray area. A menu called 'World' should pop-up. Then click the option 'Open...'. Then click 'Browser'.
[+] • For Scratch: Hold shift and click the 'R' in the Scratch logo (look at picture). Then click the option 'Turn fill screen off'. A gray area surrounds the bottom and right side. Right click the gray area. A menu called 'World' should pop-up. Then click the option 'Open...'. Then click 'Browser'.
Good, now we can start coding!
Blockspecs and Methods
Okay, for starters, we need to learn about methods and blockspecs.
Methods are the real core of the code. Its like a file that runs one code.
Blockspecs are just pieces of code that calls the methods. The blockspec for the 'move () steps' block is:
('move %n steps' #- #forward:)We will learn more about the actual content later.
But you see? The '#forward:' part calls the method 'forward:':
forward: distance
"Move the object forward (i.e., the direction of its heading) by the given distance.
Avoid infinite or NaN coordinates"
| radians deltaP newPos newX newY |
radians _ rotationDegrees degreesToRadians.
deltaP _ ((radians cos)@(radians sin)) * distance.
newPos _ self position + deltaP.
newX _ newPos x.
newY _ newPos y.
newX isNaN ifTrue: [newX _ 0].
newX isInf ifTrue: [newX _ newX sign * 10000].
newY isNaN ifTrue: [newY _ 0].
newY isInf ifTrue: [newY _ newY sign * 10000].
self position: newX @ newY.
self keepOnScreen.Of course, I don't expect you to understand you.
Some code I don't even understand fully
So when you call the 'forward:' method with that little blockspec, it will do all that code!
For further demonstration, go to the browser, make sure that the 'class' button is selected, and click Scratch-Objects, and then ScratchSpriteMorph, then block specs, and finally blockSpecs. This is where a lot of the blockspecs for blocks are held. Others are held at 'Scratch-Objects > ScratchStageMorph > block specs > blockSpecs' and 'Scratch-Objects > ScriptableScratchMorph > block specs > blockSpecs'.
To see the methods, click the button 'Instance' and go to the directed area.
This is the end of this chapter. The meaning of this chapter was to get you familiar with the area we will be coding in in later chapters. I hope it was helpful! If you need help, just leave a comment.
~Thanks to ProgrammingFreak for writing this for us!
Last edited by Tutorials-R-Us (2011-07-19 20:44:24)
Offline
As this may need to expand, we have reserved extra space so we can be prepared.
Last edited by Tutorials-R-Us (2011-06-21 10:11:47)
Offline
As this may need to expand, we have reserved extra space so we can be prepared.
Last edited by Tutorials-R-Us (2011-06-21 10:11:10)
Offline
As this may need to expand, we have reserved extra space so we can be prepared.
Last edited by Tutorials-R-Us (2011-06-21 10:10:35)
Offline
As this may need to expand, we have reserved extra space so we can be prepared.
Last edited by Tutorials-R-Us (2011-06-21 10:10:46)
Offline
As this may need to expand, we have reserved extra space so we can be prepared.
Last edited by Tutorials-R-Us (2011-06-21 10:10:54)
Offline
Offline
Offline


This Index contains a list of every single tutorial and link on this forum thread.
Tutorials
GP1's How to Add Menus
GP1's Simple Codes
Links
Last edited by Tutorials-R-Us (2011-08-02 11:18:49)
Offline
Hello! So since you are visiting this page, I assume that you have been courageous enough to learn the amazing language of SmallTalk. You probably know this language as Squeak.
Well, you can call them either.
Download
So, before we start, you need to figure out what you are going to use to test the code in this tutorials.
Here are your options:
[+] You can download the Squeak program and use it. This is the thing that Scratch was made in.
[+] You can download the source of the Scratch program. I recommend that you use this when making a modification.
[+] If you haven't already, you can just download the normal scratch.
Browser
Now, even though you have finished downloading, you still need to get to the browser. [+]The Browser is a whole system that holds all the code for the program/morph.
This is where you will do your main coding.
Now of course, since I have listed down multiple programs to use in this tutorial, there are multiple ways to get to the Browser.
• For Squeak: This is really easy, because, all you have to do is right click the gray area. A menu called 'World' should pop-up. Then click the option 'Open...'. Then click 'Browser'.
• For the Source: Click the 'File' menu while clicking Shift. Then click the option 'Exit User Mode'. A gray area surrounds the bottom and right side. Right click the gray area. A menu called 'World' should pop-up. Then click the option 'Open...'. Then click 'Browser'.
[+] • For Scratch: Hold shift and click the 'R' in the Scratch logo (look at picture). Then click the option 'Turn fill screen off'. A gray area surrounds the bottom and right side. Right click the gray area. A menu called 'World' should pop-up. Then click the option 'Open...'. Then click 'Browser'.
Good, now we can start coding!
Blockspecs and Methods
Okay, for starters, we need to learn about methods and blockspecs.
Methods are the real core of the code. Its like a file that runs one code.
Blockspecs are just pieces of code that calls the methods. The blockspec for the 'move () steps' block is:
('move %n steps' #- #forward:)We will learn more about the actual content later.
But you see? The '#forward:' part calls the method 'forward:':
forward: distance
"Move the object forward (i.e., the direction of its heading) by the given distance.
Avoid infinite or NaN coordinates"
| radians deltaP newPos newX newY |
radians _ rotationDegrees degreesToRadians.
deltaP _ ((radians cos)@(radians sin)) * distance.
newPos _ self position + deltaP.
newX _ newPos x.
newY _ newPos y.
newX isNaN ifTrue: [newX _ 0].
newX isInf ifTrue: [newX _ newX sign * 10000].
newY isNaN ifTrue: [newY _ 0].
newY isInf ifTrue: [newY _ newY sign * 10000].
self position: newX @ newY.
self keepOnScreen.Of course, I don't expect you to understand you.
Some code I don't even understand fully
So when you call the 'forward:' method with that little blockspec, it will do all that code!
For further demonstration, go to the browser, make sure that the 'class' button is selected, and click Scratch-Objects, and then ScratchSpriteMorph, then block specs, and finally blockSpecs. This is where a lot of the blockspecs for blocks are held. Others are held at 'Scratch-Objects > ScratchStageMorph > block specs > blockSpecs' and 'Scratch-Objects > ScriptableScratchMorph > block specs > blockSpecs'.
To see the methods, click the button 'Instance' and go to the directed area.
This is the end of this chapter. The meaning of this chapter was to get you familiar with the area we will be coding in in later chapters. I hope it was helpful! If you need help, just leave a comment.
~ProgrammingFreak
Offline
can you make a gravity tutorial for scratch?
Offline
ProgrammingFreak wrote:
Hello! So since you are visiting this page, I assume that you have been courageous enough to learn the amazing language of SmallTalk. You probably know this language as Squeak.
Well, you can call them either.![]()
Download
So, before we start, you need to figure out what you are going to use to test the code in this tutorials.
Here are your options:
[+] You can download the Squeak program and use it. This is the thing that Scratch was made in.
[+] You can download the source of the Scratch program. I recommend that you use this when making a modification.![]()
[+] If you haven't already, you can just download the normal scratch.
Browser
Now, even though you have finished downloading, you still need to get to the browser. [+]The Browser is a whole system that holds all the code for the program/morph.
This is where you will do your main coding.
Now of course, since I have listed down multiple programs to use in this tutorial, there are multiple ways to get to the Browser.
• For Squeak: This is really easy, because, all you have to do is right click the gray area. A menu called 'World' should pop-up. Then click the option 'Open...'. Then click 'Browser'.
• For the Source: Click the 'File' menu while clicking Shift. Then click the option 'Exit User Mode'. A gray area surrounds the bottom and right side. Right click the gray area. A menu called 'World' should pop-up. Then click the option 'Open...'. Then click 'Browser'.
[+] • For Scratch: Hold shift and click the 'R' in the Scratch logo (look at picture). Then click the option 'Turn fill screen off'. A gray area surrounds the bottom and right side. Right click the gray area. A menu called 'World' should pop-up. Then click the option 'Open...'. Then click 'Browser'.
Good, now we can start coding!![]()
Blockspecs and Methods
Okay, for starters, we need to learn about methods and blockspecs.
Methods are the real core of the code. Its like a file that runs one code.
Blockspecs are just pieces of code that calls the methods. The blockspec for the 'move () steps' block is:Code:
('move %n steps' #- #forward:)We will learn more about the actual content later.
![]()
But you see? The '#forward:' part calls the method 'forward:':Code:
forward: distance "Move the object forward (i.e., the direction of its heading) by the given distance. Avoid infinite or NaN coordinates" | radians deltaP newPos newX newY | radians _ rotationDegrees degreesToRadians. deltaP _ ((radians cos)@(radians sin)) * distance. newPos _ self position + deltaP. newX _ newPos x. newY _ newPos y. newX isNaN ifTrue: [newX _ 0]. newX isInf ifTrue: [newX _ newX sign * 10000]. newY isNaN ifTrue: [newY _ 0]. newY isInf ifTrue: [newY _ newY sign * 10000]. self position: newX @ newY. self keepOnScreen.Of course, I don't expect you to understand you.
Some code I don't even understand fully
![]()
So when you call the 'forward:' method with that little blockspec, it will do all that code!![]()
For further demonstration, go to the browser, make sure that the 'class' button is selected, and click Scratch-Objects, and then ScratchSpriteMorph, then block specs, and finally blockSpecs. This is where a lot of the blockspecs for blocks are held. Others are held at 'Scratch-Objects > ScratchStageMorph > block specs > blockSpecs' and 'Scratch-Objects > ScriptableScratchMorph > block specs > blockSpecs'.
To see the methods, click the button 'Instance' and go to the directed area.
This is the end of this chapter. The meaning of this chapter was to get you familiar with the area we will be coding in in later chapters. I hope it was helpful! If you need help, just leave a comment.![]()
~ProgrammingFreak
THANK YOU!! finally someone has posted!! ill add it in just a second...
EDIT: i suppose this goes in the basics section
~hello
Last edited by Tutorials-R-Us (2011-07-19 20:40:33)
Offline
Maybe I should get the pass.
You messed up on BBCode and grammar.
Offline