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

#576 2010-12-07 07:15:10

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: Welcome to the OLD local block library!

sparks wrote:

Control

[blocks, code, pix, credits edited out to save room]

http://i53.tinypic.com/5bqjxh.jpghttp://img541.imageshack.us/img541/995/13864697.gif Shared by Zorket
Blockspec:

('set single stepping' #- #setSpeed)

Code:

setSpeed
    | t1 t2 |
    t1 _ CustomMenu new title: 'Single-step speed?'.
    t1 add: 'Turbo speed' action: 0.
    t1 add: 'Normal' action: 1.
    t1 add: 'Flash blocks (fast)' action: 30.
    t1 add: 'Flash blocks (slow)' action: 200.
    t2 _ t1 localize startUp.
    t2 ifNil: [^ self].
    ScratchProcess blockHighlightMSecs: t2

[b] What it does:[b]
This block lets you change the speed of your project! Very useful when you want a mix of fast computing and good graphics.

http://dl.dropbox.com/u/6273449/BlockLibDiv2.png
^ Back to Scratch Blocks
^ Back to Contents

mistake in the coding: [b] What it does:[b] should be [b] What it does:[/b]

Last edited by scimonster (2011-01-10 08:22:08)

Offline

 

#577 2010-12-07 08:25:23

zorket
Scratcher
Registered: 2010-05-25
Posts: 500+

Re: Welcome to the OLD local block library!

zorket wrote:

[open string dialog to type in]

blockspec:

('open string dialog to type in' #- #openTypeDialog)

non - tested code:

Code:

openTypeDialog
| t1 |
t1 _ StringDialog ask: 'type.'

Marzipan11 must learn to not spoil

Offline

 

#578 2010-12-07 10:24:26

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Welcome to the OLD local block library!

I think Zorket probably misunderstood "How do I get what they typed in?" meaning something to do with how he used BBcode, and added the mistake so the bbcode would show up...

Zorket, What people are trying to say is:

Once you have run the block you posted, how can a user read the text you typed into the string dialog in the same way that you need to read the "answer" to the "ask" block with a reporter.

In answer, the block Zorket posted IS a reporter. It asks the question and then reports the answer.

Last edited by sparks (2010-12-07 10:29:59)


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#579 2010-12-08 11:48:34

subzerostig
Scratcher
Registered: 2010-09-08
Posts: 100+

Re: Welcome to the OLD local block library!

Are you going to update with my blocks?
just asking


There are 10 types of people people in this world, those that understand binary and those that do not: My latest Project: Present catcher V2                          06/12/2012

Offline

 

#580 2010-12-08 13:09:19

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Welcome to the OLD local block library!

yes! I'm updating as we speak.


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#581 2010-12-08 13:31:17

subzerostig
Scratcher
Registered: 2010-09-08
Posts: 100+

Re: Welcome to the OLD local block library!

Yay
big_smile

Last edited by subzerostig (2010-12-08 13:33:59)


There are 10 types of people people in this world, those that understand binary and those that do not: My latest Project: Present catcher V2                          06/12/2012

Offline

 

#582 2010-12-08 15:04:31

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Welcome to the OLD local block library!

.                              http://img528.imageshack.us/img528/4416/66858359.gif

Scratch blocks added: [3]


Panther blocks added: [0]


BYOB blocks added: [14]


Block requests added: [2]

Other Updates:

♦ Subzerostig: your ( )^( ) block has not been added because it has already been shared, sorry  hmm



________________________________________________________________________________
^home
^updates archive


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#583 2010-12-08 19:55:28

zorket
Scratcher
Registered: 2010-05-25
Posts: 500+

Re: Welcome to the OLD local block library!

Thanks for the tip, sparks.

I have made another block. Wrote it myself.
[open user page]

blockspec:

'open user page' #- #openUserPage

Code:

openUserPage
| t1 |
t1 StringDialog askWithCancel: 'user name:'.
t1 size = 0 ifTrue: [^ self].
Cursor wait showWhile: [ScratchPlugin primOpenURL: 'http://scratch.mit.edu/users/', t1]

Last edited by zorket (2010-12-10 16:21:15)


Marzipan11 must learn to not spoil

Offline

 

#584 2010-12-08 21:24:16

me450
Scratcher
Registered: 2009-03-31
Posts: 56

Re: Welcome to the OLD local block library!

sparks wrote:

I think Zorket probably misunderstood "How do I get what they typed in?" meaning something to do with how he used BBcode, and added the mistake so the bbcode would show up...

Zorket, What people are trying to say is:

Once you have run the block you posted, how can a user read the text you typed into the string dialog in the same way that you need to read the "answer" to the "ask" block with a reporter.

In answer, the block Zorket posted IS a reporter. It asks the question and then reports the answer.

oh.  i made it a command block

EDIT:

its reporter now. it just says "A ScratchSpriteMorph()" when it gets input

Last edited by me450 (2010-12-08 21:26:45)

Offline

 

#585 2010-12-09 05:53:00

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: Welcome to the OLD local block library!

Hardmath123 wrote:

Ta-Da!

Code:

getconstant: t1 
    t1 = 'pi' ifTrue: [^ '3.141592653'].
    t1 = 'phi' ifTrue: [^ '1.61803399'].
    t1 = 'e' ifTrue: [^ '2.71828183'].
    t1 = 'sqrt 2' ifTrue: [^ '1.41421356'].
    ^ 3.141592653

Code:

('%T' #r #getconstant:)

Scratch-Objects»ScriptableScratchMorph»sensing


Code:

constants
    ^ #('pi' 'phi' 'e' 'sqrt 2' )

Scratch-Blocks»CommandBlockMorph»-- all --»uncoloredArgMorphFor:

REPLACE ALL WITH

Code:

uncoloredArgMorphFor: t1 
    | t2 |
    t2 _ t1 at: 2.
    $a = t2 ifTrue: [^ AttributeArgMorph new choice: 'volume'].
    $b = t2 ifTrue: [^ BooleanArgMorph new].
    $c = t2 ifTrue: [^ ColorArgMorph new showPalette: true].
    $C = t2 ifTrue: [^ ColorArgMorph new showPalette: false].
    $d = t2 ifTrue: [^ ExpressionArgMorphWithMenu new numExpression: '0';
         menuSelector: #directionMenu].
    $D = t2 ifTrue: [^ ExpressionArgMorphWithMenu new numExpression: '48';
         menuSelector: #midiDrumMenu].
    $e = t2 ifTrue: [^ EventTitleMorph new].
    $f = t2 ifTrue: [^ ChoiceArgMorph new getOptionsSelector: #mathFunctionNames;
         choice: 'sqrt'].
    $g = t2 ifTrue: [^ ChoiceArgMorph new getOptionsSelector: #graphicEffectNames;
         choice: 'color'].
    $H = t2 ifTrue: [^ ChoiceArgMorph new getOptionsSelector: #hookupSensorNames].
    $h = t2 ifTrue: [^ ChoiceArgMorph new getOptionsSelector: #hookupBooleanSensorNames].
    $I = t2 ifTrue: [^ ExpressionArgMorphWithMenu new numExpression: '1';
         menuSelector: #midiInstrumentMenu].
    $i = t2 ifTrue: [^ ExpressionArgMorphWithMenu new numExpression: '1';
         menuSelector: #listIndexMenu].
    $k = t2 ifTrue: [^ ChoiceArgMorph new getOptionsSelector: #keyNames;
         choice: 'space'].
    $L = t2 ifTrue: [^ ChoiceArgMorph new getOptionsSelector: #listVarMenu].
    $l = t2 ifTrue: [^ ChoiceOrExpressionArgMorph new getOptionsSelector: #costumeNames;
         choice: 'costume1'].
    $m = t2 ifTrue: [^ SpriteArgMorph new].
    $M = t2 ifTrue: [^ ChoiceArgMorph new getOptionsSelector: #motorNames].
    $n = t2 ifTrue: [^ ExpressionArgMorph new numExpression: '10'].
    $N = t2 ifTrue: [^ ExpressionArgMorphWithMenu new numExpression: '60';
         menuSelector: #noteSelector].
    $s = t2 ifTrue: [^ ExpressionArgMorph new stringExpression: ''].
    $S = t2 ifTrue: [^ ChoiceOrExpressionArgMorph new getOptionsSelector: #soundNames;
         choice: 'pop'].
    $v = t2 ifTrue: [^ ChoiceArgMorph new getOptionsSelector: #varNamesMenu;
         choice: ''].
    $W = t2 ifTrue: [^ ChoiceArgMorph new getOptionsSelector: #motorDirection].
    $x = t2 ifTrue: [^ ChoiceOrExpressionArgMorph new getOptionsSelector: #sceneNames;
         choice: ''].
    $y = t2 ifTrue: [^ ExpressionArgMorphWithMenu new numExpression: '1';
         menuSelector: #listIndexForDeleteMenu].
    $T = t2 ifTrue: [^ ChoiceOrExpressionArgMorph new getOptionsSelector: #constants;
         choice: 'pi'].
    ^ ExpressionArgMorph new numExpression: '10'

Gives out the selected constants. Note the better arrows '»'

Meant to replace the pi block Zorket and I gave.

If you want to add a constant, just tell me.

*ahem*


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#586 2010-12-09 09:29:34

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: Welcome to the OLD local block library!

scimonster wrote:

have you made any custom blocks in scratch?
have you made projects with them?
are you annoyed that you are the only one who can run them?
do you wish you could share those projects?

now you can!    smile

put a link to the project here, along with the blockspecs and coding for the blocks

What are you going to do with 32 scratch blocks if not use them in projects?

Offline

 

#587 2010-12-09 09:51:19

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Welcome to the OLD local block library!

@ Zorket, Thanks for the user block, but I've already made one. Mine does not ask the name of the user in a dialog, but I think that's better because otherwise you have to have a dialog box asking to input a user  hmm  Also, what tip and how is it broken?

@Hardmath123, sorry, I must have missed it, I'll add it in a bit  smile

@me450, I tried zorket's ask as reporter block code and it worked for me... you must have made a mistake somewhere.

@scimonster, what?!


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#588 2010-12-09 10:20:09

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: Welcome to the OLD local block library!

sparks wrote:

@scimonster, what?!

if you make all 32 blocks you have here, what are you going to do?  look at them for fun.  no.  use it in a project.  and what's the point if you can't share it?  thats what this topic is for, projects that use custom blocks.

Offline

 

#589 2010-12-09 13:13:36

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Welcome to the OLD local block library!

... I never said it wasn't! I still stand by what I said on that thread though:

sparks wrote:

You might like to credit Billyedward who was the person who first came up with the code for the URL link block you posted above  smile


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#590 2010-12-09 15:22:13

ESN
New Scratcher
Registered: 2010-12-03
Posts: 100+

Re: Welcome to the OLD local block library!

Hey, I just thought you might want a cleaned up version of the Panther blocks image.

Code:

http://i55.tinypic.com/29cvqio.png

________________________________________

The pen shade block:

Code:

('pen shade' #r #penShade)

Scratch-Objects >> ScriptableSpriteMorph >> pen ops

Code:

penShade
    ^ penShade

http://is.gd/jZ5chhttp://is.gd/jZhXDhttp://is.gd/jZhU7

Offline

 

#591 2010-12-09 15:24:03

JeanTheFox
Scratcher
Registered: 2010-06-14
Posts: 1000+

Re: Welcome to the OLD local block library!

Sorry about the above post... :P

I'll try that again:

Hey, I just thought you might want a cleaned up version of the Panther blocks image.

http://i55.tinypic.com/29cvqio.png
________________________________________

The pen shade block:

http://i54.tinypic.com/11lmz2r.png

Code:

('pen shade' #r #penShade)

Scratch-Objects >> ScriptableSpriteMorph >> pen ops

Code:

penShade
    ^ penShade

Last edited by JeanTheFox (2010-12-09 15:25:17)


http://i51.tinypic.com/20gcn5j.png

Offline

 

#592 2010-12-10 05:33:08

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Welcome to the OLD local block library!

Thanks for the cleanup JeanTheFox! I'll add it now  smile

The penshade block has already been shared here I'm afraid  hmm  But thanks for your submission!


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#593 2010-12-10 11:42:13

MathWizz
Scratcher
Registered: 2009-08-31
Posts: 1000+

Re: Welcome to the OLD local block library!

Tada!
http://img10.imageshack.us/img10/8629/iftouchingbounce.gif
BlockSpec:

Code:

('if touching %m bounce' #- #bounceOffSprite:)

Code:

Code:

bounceOffSprite: aName 
    | sprite oldDir |
    sprite _ self coerceSpriteArg: aName.
    (self touching: sprite)
        ifFalse: [^ self].
    oldDir _ self heading.
    self pointTowards: sprite.
    self turnRight: self heading - oldDir + 180.
    [self touching: sprite]
        whileTrue: [self forward: 1]

Not bad for my first block in the library, eh?


http://block.site90.net/scratch.mit/text.php?size=30&text=%20A%20signature!&color=333333

Offline

 

#594 2010-12-10 12:07:04

subzerostig
Scratcher
Registered: 2010-09-08
Posts: 100+

Re: Welcome to the OLD local block library!

MathWizz wrote:

Tada!
http://img10.imageshack.us/img10/8629/i … bounce.gif
BlockSpec:

Code:

('if touching %m bounce' #- #bounceOffSprite:)

Code:

Code:

bounceOffSprite: aName 
    | sprite oldDir |
    sprite _ self coerceSpriteArg: aName.
    (self touching: sprite)
        ifFalse: [^ self].
    oldDir _ self heading.
    self pointTowards: sprite.
    self turnRight: self heading - oldDir + 180.
    [self touching: sprite]
        whileTrue: [self forward: 1]

Not bad for my first block in the library, eh?

That block will be really useful for physics games!!!


There are 10 types of people people in this world, those that understand binary and those that do not: My latest Project: Present catcher V2                          06/12/2012

Offline

 

#595 2010-12-10 12:16:59

MathWizz
Scratcher
Registered: 2009-08-31
Posts: 1000+

Re: Welcome to the OLD local block library!

subzerostig wrote:

MathWizz wrote:

Tada!
http://img10.imageshack.us/img10/8629/i … bounce.gif
BlockSpec:

Code:

('if touching %m bounce' #- #bounceOffSprite:)

Code:

Code:

bounceOffSprite: aName 
    | sprite oldDir |
    sprite _ self coerceSpriteArg: aName.
    (self touching: sprite)
        ifFalse: [^ self].
    oldDir _ self heading.
    self pointTowards: sprite.
    self turnRight: self heading - oldDir + 180.
    [self touching: sprite]
        whileTrue: [self forward: 1]

Not bad for my first block in the library, eh?

That block will be really useful for physics games!!!

It's not very accurate right now... It assumes the sprites are circles, but it can still be useful.

Last edited by MathWizz (2010-12-10 12:17:46)


http://block.site90.net/scratch.mit/text.php?size=30&text=%20A%20signature!&color=333333

Offline

 

#596 2010-12-10 14:20:08

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Welcome to the OLD local block library!

The Block library now has a link to it on the BYOB homepage! Woo for continuous progress!


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#597 2010-12-10 16:17:56

zorket
Scratcher
Registered: 2010-05-25
Posts: 500+

Re: Welcome to the OLD local block library!

I have a new untested block called (letter () ).
Untested, again.

blockspec:

('letter %n' #r #letter:)

LONG code:

Code:

letter: t1
t1 = 1 ifTrue: ^ 'a'.
t1 = 2 ifTrue: ^ 'b'.
t1 = 3 ifTrue: ^ 'c'.
t1 = 4 ifTrue: ^ 'd'.
t1 = 5 ifTrue: ^ 'e'.
t1 = 6 ifTrue: ^ 'f'.
t1 = 7 ifTrue: ^ 'g'.
t1 = 8 ifTrue: ^ 'h'.
t1 = 9 ifTrue: ^ 'i'.
t1 = 10 ifTrue: ^ 'j'.
t1 = 11 ifTrue: ^ 'k'.
t1 = 12 ifTrue: ^ 'l'.
t1 = 13 ifTrue: ^ 'm'.
t1 = 14 ifTrue: ^ 'n'.
t1 = 15 ifTrue: ^ 'o'.
t1 = 16 ifTrue: ^ 'p'.
t1 = 17 ifTrue: ^ 'q'.
t1 = 18 ifTrue: ^ 'r'.
t1 = 19 ifTrue: ^ 's'.
t1 = 20 ifTrue: ^ 't'.
t1 = 21 ifTrue: ^ 'u'.
t1 = 22 ifTrue: ^ 'v'.
t1 = 23 ifTrue: ^ 'w'.
t1 = 24 ifTrue: ^ 'x'.
t1 = 25 ifTrue: ^ 'y'.
t1 = 26 ifTrue: ^ 'z'.
^ 'Error!'

What I have to say that every block I say is DEFFERENT. And I work HARD on them. So please, PLEASE add them! I'm begging you!

Last edited by zorket (2010-12-10 16:22:59)


Marzipan11 must learn to not spoil

Offline

 

#598 2010-12-10 18:41:45

ryan49ryan
New Scratcher
Registered: 2010-12-09
Posts: 3

Re: Welcome to the OLD local block library!

[blocks]<rotational direction[/blocks]
HI
I would like a block that senses clockwise and counterclockwise motion.
I have a scratch project with a dial that turns to the mouse pointer but even when you are turning the opposite way there is the same event. I want 2 events for this button 1 for turning clockwise and one for turning counter-clockwise. Thanks

Offline

 

#599 2010-12-10 21:12:02

SSBBM
Scratcher
Registered: 2009-10-09
Posts: 100+

Re: Welcome to the OLD local block library!

Man, I have no idea what you guys are saying with your scratch code. Could anyone help me with coming up with BYOB block?

Edit: New Block

http://img413.imageshack.us/img413/659/negof.gif

Last edited by SSBBM (2010-12-10 21:18:35)


http://goo.gl/zVfAp http://goo.gl/laci8

Offline

 

#600 2010-12-10 21:25:07

meowmeow55
Scratcher
Registered: 2008-12-24
Posts: 1000+

Re: Welcome to the OLD local block library!

SSBBM wrote:

Man, I have no idea what you guys are saying with your scratch code. Could anyone help me with coming up with BYOB block?

And I'm over here, wishing that people would stop coming up with BYOB blocks, 'cause I'm getting overloaded with building the BYOB Block Library project.  tongue

sparks, can you compile a list of BYOB blocks not in the project and provide easy access to them? 'Cause I'm, er, sorta behind  tongue


Yawn.

Offline

 

Board footer