^Back to Panther blocks
downloading a Panther block
Download the block
or follow the tutorial:
To download a Panther block from the library, follow these steps:
Open Panther and go to the variables tab. Scroll down and select "make a block". A popup box will appear asking for the block name. paste in this code:
download block $Number$ from block library
Click OK. A new window will appear with several boxes in it. The top one has the text you just entered. choose a colour from the colour swatch in the top right corner, and copy this code into the large box:
|maker link t2 t3 t4| link_'http://dl.dropbox.com/u/6273449/', t1 asString, '.txt'. maker_self readLine: 1 FromUrl: link. t1_self readLine: 2 FromUrl: link. t2_self readLine: 3 FromUrl: link. t4_self readLine: 4 FromUrl: link. t4_self stringAsColor: t4. t3_self readLine: 5 FromUrl: link. createdBlocks at: t1 put: {t1. t1. '-'. ''. self class blockColorFor: 'custom'}.createdBlocks at: t1 put: {t1. t1. t2. t3. t4}.(t4 _ self ownerThatIsA: ScratchFrameMorph) ifNotNil: [t4 viewerPane categoryChanged: 'variables']. self showInformDialog: 'sucess!' withText: 'The block has been added to your variables tab.', ' ', 'The "', t1, '" block', ' ', ' was shared by ', maker
so it looks like this:
Click Ok and you should find a new block in the variables tab at the bottom that looks like this:
Once you have this block, you can browse the Panther section of the block library for a block you want, and then enter the "block number" next to it into your download block. Double click the block to make it work and the new block will be added to the variables tab along with the rest. Click here to start browsing Panther blocks.
^Back to Panther blocks
Last edited by sparks (2011-01-22 03:01:24)
Offline
sparks wrote:
good points there meowmeow55, If I used that block I would want the sprite that drew it to return to it's original position with it's pen up as if it hadn't drawn the line (though what if the pen was already down before the line was drawn?)
We'd need a <pen down?> boolean block for that...
I've added those new blocks, however, how did you get the <= and => symbols? I tried the supposedly correct alt codes 242 and 243 but got ‗ and ¾ for some reason...
I used the character map
Offline
^Back to BYOB blocks
Making a BYOB block from the library
1) Open BYOB and go to the bottom of the variables tab. Click on the "make a block" button. OR right-click and press 'make a block'
2) A window appears. Type the name of the block into the text box. Select the category and type of block then click OK
3)A new window appears. Drag the blocks (like you would do for a normal script) that are in the library.
4)To add variables
a)add the block 'script variables () >' to add some that the user can not see or change (unless changing other vars)
b)click + next to any text for some like
5) With any luck you can drag out the new block and use it! If you take a block from the library that does not have a image next to it, do post in this thread and share whether it worked or not!
____________________________________
^Back to BYOB blocks
Last edited by SSBBM (2010-12-02 15:44:35)
Offline
SSBBM, loving your BYOB tutorial there! I've linked it to the BYOB post!
Anyone fancy the terribly harder task of creating a "how to find the right place in the code" plus the "shift click the R" bits?
Offline
This is sitting in the glossary, and no one has brought it up, so I will:
sparks wrote:
Instance: commonly misunderstood word... not sure what it means myself, please do post a lamen's terms explaination for this!
Can anyone explain how this word came to be so commonly misused and what the real definition is (and why it is used on a button in the third panel of Scratch's System Browser, while we're at it)?
Offline
meowmeow55 wrote:
This is sitting in the glossary, and no one has brought it up, so I will:
sparks wrote:
Instance: commonly misunderstood word... not sure what it means myself, please do post a lamen's terms explaination for this!
Can anyone explain how this word came to be so commonly misused and what the real definition is (and why it is used on a button in the third panel of Scratch's System Browser, while we're at it)?
I'm not sure at all what it means, merely that what I think it means is probably wrong...
a proper explaination would, I'm sure help to clear this up
Offline
For Squeak?
A form of a class that executes once called, and can launch once it is called or a condition is met in it's class.
Offline
Okay, instance:
An instance is (in Squeak) an object with some class as its data type. The instance has its own set of properties (variables) and methods (functions) which can be different from those of another instance. In a Squeak browser, the "instance" and "class" buttons let the user edit both the instance methods (those belonging to every instance created) and the class methods (those belonging to the class itself but accessible by anything).
Confusion has come up around the word "instance" because it is often incorrectly used as a word for "instance method" or "method" because of its location and use in a Squeak system browser.
For further reading see:
- Instance (Computer Science)
- Object-Oriented Programming
- Squeak
Offline
nXIII wrote:
Okay, instance:
An instance is (in Squeak) an object with some class as its data type. The instance has its own set of properties (variables) and methods (functions) which can be different from those of another instance. In a Squeak browser, the "instance" and "class" buttons let the user edit both the instance methods (those belonging to every instance created) and the class methods (those belonging to the class itself but accessible by anything).
Confusion has come up around the word "instance" because it is often incorrectly used as a word for "instance method" or "method" because of its location and use in a Squeak system browser.
For further reading see:
- Instance (Computer Science)
- Object-Oriented Programming
- Squeak
I tried.
Offline
I have't had much computer time so:
meowmeow55 wrote:
What exactly is that block supposed to do? I don't get what the comments are trying to convey either.
It's hard to say. It wasn't a good block anyways. Sparks, you can delete it.
BTW, you should make an image for the List category, too.
Also, should your "make a line from ..." block make the sprite go back to its original position after drawing a line, and make the pen go back up?
--------------------------------
sparks wrote:
SSBBM, loving your BYOB tutorial there! I've linked it to the BYOB post!
Thanks! If you want, you can copy and repost it so you can edit it and I'll delete mine.
--------------------------------
johnnydean1 wrote:
It should be report true
--------------------------------
And I have
Last edited by SSBBM (2010-11-21 16:17:30)
Offline
zorket wrote:
To make a scratch block:
1.) Open scratch, shift click in the loop in R:
http://newsimg.bbc.co.uk/media/images/4 … ch_203.jpg
The blue text does not appear in the editor, so open the editor.
Then click on the white space that appears, go to open-browser.
2.) The browser should look like:
http://www.gershmer.net/runtimeimage/runtime4.jpeg You really should be working on 1.4.
Go above, and click scratch objects.
[Scratch sprite morph for sprite only blocks, Scratch stage morph for stage blocks only, and ScriptableScratchMorph for both, go to ScriptableScratchMorph in the example, please]
Then you go LOW and press class. then go to the third pane, click blockspecs//scratch. In the 4th pane, blockspecs.
3.) Here's a really hard step. You have to locate yourself where the blockspec goes!
Alright. If you are following the tutorial, you should be in ScriptableScratchMorph.
Find 'control'. look across the line, and you will see a #-. Use a #- when you want to put a space in. And you will find a ('repeat %n' #c #doRepeat 10).Code:
The block contents is first in the brackets. There have to be brackets for strings, always. example: 'repeat %n' ________________________ The #c tells what type of block this is. Here is a list: #- no arguments (command or 'stack' block) #r Reporter block (the round ones) #b boolean block (diamond shaped) #c C shaped block (like the forever block) #t Time block (like wait X secs) #W 'when' hat block (obsolete) #S start button click hat block #K key-activated hat block #E event hat block (broadcast) #s special form (hard to code) Credit to ls97 for this list. ______________________ The #doRepeat 10 is the command. It has to be exact to the name of the code.You also might be wondering what the %n is doing there.
This indicates a numberical inserter. Here is a list of them:Code:
a: attribute of another sprite, such as X position or size. b: a boolean inserter c: a colour picker that shows the menu. C: a colour picker that doesn't d: the sprite direction menu/numerical inserter. D: the menu for midi drums e: The broadcast message menu f: math function menu (with sin, abs, etc.) g: menu for the different graphic effects. h: numerical sensor board selector menu H: boolean sensor board selector menu i: midi instrument menu/numerical inserter k: menu for the names of the different keys, used in the key sensor blocks. l: menu with the costume names of the given sprite. L: list name menu. m: sprite list n: numerical inserter N: note name menu/inserter s: string inserter S: sound selector menu v: variable labels menu y: menu used to delete either a number of the last value or all of a list.Credit to ls97 and billyedward for this list.
Alright, for the tutorial, were gonna make the ( report (hello) ) block. Add the blockspec: ('report %s' #r #report: 'hello') Place it in control or operators.
4.) Now were going to move on to codes. Some blocks already have the code installed.
For the ( report (hello) ) block were doing, there is a place were gonna put this code.
Click on instance in the 2nd pane low. In the third pane, other ops, and the 4th, add new code or replace any code. Use the code for the ( report (hello) ) block:Code:
report: t1 ^ t1this is the short code. Accept.
I'm gonna help you figure out more stuff. Here's an extra-long helpers code:Code:
report: t1 | t2 t3 | t1 _ t2 t2 _ t3 t3 = t1 ifTrue: [^ t1]The | t2 t3| adds the variables t2 and t3 to the code.
t1 _ t2 makes t2 equal t1.
t2 _ t3 makes t3 equal t2.
t3 = t1 ifTrue: [^ t1] checks if t3 = t1, if it does, it does the command inside [], and ^ makes it report t1 (the string)
There you go! With a little practice, you can make your own blocks! Oh, I almost forgot. Close the green code, and turn fill screen on with the first in step 1. If you are positive you want this block permonant, use the shift-click methood and click save-image.
With this tutorial, there are no bondaries for blocks.
You can even make a [if touching (a sprite), die] block!!!
We have several of these already. Could you please delete this so that we have more forum space?
And also, check out Cool Custom Blocks In Scratch to see the full tutorial (as of now , made by LS97)
Offline
bbbeb wrote:
zorket wrote:
To make a scratch block:
1.) Open scratch, shift click in the loop in R:
http://newsimg.bbc.co.uk/media/images/4 … ch_203.jpg
The blue text does not appear in the editor, so open the editor.
Then click on the white space that appears, go to open-browser.
2.) The browser should look like:
http://www.gershmer.net/runtimeimage/runtime4.jpeg You really should be working on 1.4.
Go above, and click scratch objects.
[Scratch sprite morph for sprite only blocks, Scratch stage morph for stage blocks only, and ScriptableScratchMorph for both, go to ScriptableScratchMorph in the example, please]
Then you go LOW and press class. then go to the third pane, click blockspecs//scratch. In the 4th pane, blockspecs.
3.) Here's a really hard step. You have to locate yourself where the blockspec goes!
Alright. If you are following the tutorial, you should be in ScriptableScratchMorph.
Find 'control'. look across the line, and you will see a #-. Use a #- when you want to put a space in. And you will find a ('repeat %n' #c #doRepeat 10).Code:
The block contents is first in the brackets. There have to be brackets for strings, always. example: 'repeat %n' ________________________ The #c tells what type of block this is. Here is a list: #- no arguments (command or 'stack' block) #r Reporter block (the round ones) #b boolean block (diamond shaped) #c C shaped block (like the forever block) #t Time block (like wait X secs) #W 'when' hat block (obsolete) #S start button click hat block #K key-activated hat block #E event hat block (broadcast) #s special form (hard to code) Credit to ls97 for this list. ______________________ The #doRepeat 10 is the command. It has to be exact to the name of the code.You also might be wondering what the %n is doing there.
This indicates a numberical inserter. Here is a list of them:Code:
a: attribute of another sprite, such as X position or size. b: a boolean inserter c: a colour picker that shows the menu. C: a colour picker that doesn't d: the sprite direction menu/numerical inserter. D: the menu for midi drums e: The broadcast message menu f: math function menu (with sin, abs, etc.) g: menu for the different graphic effects. h: numerical sensor board selector menu H: boolean sensor board selector menu i: midi instrument menu/numerical inserter k: menu for the names of the different keys, used in the key sensor blocks. l: menu with the costume names of the given sprite. L: list name menu. m: sprite list n: numerical inserter N: note name menu/inserter s: string inserter S: sound selector menu v: variable labels menu y: menu used to delete either a number of the last value or all of a list.Credit to ls97 and billyedward for this list.
Alright, for the tutorial, were gonna make the ( report (hello) ) block. Add the blockspec: ('report %s' #r #report: 'hello') Place it in control or operators.
4.) Now were going to move on to codes. Some blocks already have the code installed.
For the ( report (hello) ) block were doing, there is a place were gonna put this code.
Click on instance in the 2nd pane low. In the third pane, other ops, and the 4th, add new code or replace any code. Use the code for the ( report (hello) ) block:Code:
report: t1 ^ t1this is the short code. Accept.
I'm gonna help you figure out more stuff. Here's an extra-long helpers code:Code:
report: t1 | t2 t3 | t1 _ t2 t2 _ t3 t3 = t1 ifTrue: [^ t1]The | t2 t3| adds the variables t2 and t3 to the code.
t1 _ t2 makes t2 equal t1.
t2 _ t3 makes t3 equal t2.
t3 = t1 ifTrue: [^ t1] checks if t3 = t1, if it does, it does the command inside [], and ^ makes it report t1 (the string)
There you go! With a little practice, you can make your own blocks! Oh, I almost forgot. Close the green code, and turn fill screen on with the first in step 1. If you are positive you want this block permonant, use the shift-click methood and click save-image.
With this tutorial, there are no bondaries for blocks.
You can even make a [if touching (a sprite), die] block!!!We have several of these already. Could you please delete this so that we have more forum space?
And also, check out Cool Custom Blocks In Scratch to see the full tutorial (as of now , made by LS97)
Sorry, but I spent hours posting that. I don't really want to delete it. And I think sparks was looking for a scratch tutorial...?
p.s. I've seen and worked in the cool custom blocks in scratch.
Last edited by zorket (2010-10-26 08:04:12)
Offline
My fault, bbeb, I asked for a quick guide to making scratch blocks...
Zorket, the images you use don't all seem to be from scratch, rather than scratch, it says "Based on scratch from the MIT media labs" in the corner... This might be confusing to new users, especially using the scratch logo instead of the one found in scratch itself Thank you for your submission all the same:)
Offline
sparks wrote:
My fault, bbeb, I asked for a quick guide to making scratch blocks...
Zorket, the images you use don't all seem to be from scratch, rather than scratch, it says "Based on scratch from the MIT media labs" in the corner... This might be confusing to new users, especially using the scratch logo instead of the one found in scratch itself Thank you for your submission all the same:)
Oh. My bad. But why not make a new topic and post a link?
Offline
New scratch blocks!
Clone sprite
Blockspecs:
('clone me' #- #duplicate)
This is actually by ScratchReallyRocks, I just posted it here first.
Delete sprite
('delete me' #- #delete)
this one is based on his, but my code.
Offline
zorket wrote:
True is tested.
All operators iz tethted.
All operators for all block types? which set of operators have you tested? Scratch blocks?
Thanks for the new scratch blocks, 16Skittles, I'll add them to the scratch control section. However, I'm going to change the cloning code just a little. With your current code of "duplicate" you end up with the cloned sprite stuck to your mouse pointer until you click. if you use the code "duplicateNoAttatch", the sprite will clone and place itself onto the stage much more useful for in-game cloning!
Offline
^ but it wont work in presentation mode
Offline