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

#651 2010-06-15 11:59:53

TheGameMaster1231
Scratcher
Registered: 2009-07-24
Posts: 1000+

Re: Cool custom blocks in Scratch

ScratchReallyROCKS wrote:

LS97 wrote:

johnnydean1 wrote:

@LS97
Can you make a (pitch) block.
Like loundness, but for pitch

no, i cant. pitch is not a simple value, it's hard to sense it.
but i think you can do something with the picoboard, not sure though.

No, that's just loudness. A pitch block would be REALLY nice though.

I Agree. A Pitch Block Would Be Pretty Cool.

Offline

 

#652 2010-06-15 12:45:50

Billybob-Mario
Scratcher
Registered: 2008-01-05
Posts: 500+

Re: Cool custom blocks in Scratch

TheGameMaster1231 wrote:

ScratchReallyROCKS wrote:

LS97 wrote:


no, i cant. pitch is not a simple value, it's hard to sense it.
but i think you can do something with the picoboard, not sure though.

No, that's just loudness. A pitch block would be REALLY nice though.

I Agree. A Pitch Block Would Be Pretty Cool.

How to win the game: Say, "I don't care about the game. It doesn't matter. I quit the game." Then, you win!

Offline

 

#653 2010-06-15 13:14:14

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Cool custom blocks in Scratch

what the ___?

Offline

 

#654 2010-06-15 13:14:47

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: Cool custom blocks in Scratch

Using pitch block..


You can now reach me on Twitter @johnnydean1_

Offline

 

#655 2010-06-15 13:18:55

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Cool custom blocks in Scratch

i mean billybob's post.

Offline

 

#656 2010-06-15 13:51:14

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: Cool custom blocks in Scratch

Billybob-Mario wrote:

TheGameMaster1231 wrote:

ScratchReallyROCKS wrote:

No, that's just loudness. A pitch block would be REALLY nice though.

I Agree. A Pitch Block Would Be Pretty Cool.

How to win the game: Say, "I don't care about the game. It doesn't matter. I quit the game." Then, you win!

That's a bit off-topic...

http://xkcd.com/391/

Last edited by nXIII (2010-06-15 13:51:41)


nXIII

Offline

 

#657 2010-06-15 14:32:59

TheGameMaster1231
Scratcher
Registered: 2009-07-24
Posts: 1000+

Re: Cool custom blocks in Scratch

nXIII wrote:

Billybob-Mario wrote:

TheGameMaster1231 wrote:


I Agree. A Pitch Block Would Be Pretty Cool.

How to win the game: Say, "I don't care about the game. It doesn't matter. I quit the game." Then, you win!

That's a bit off-topic...

http://xkcd.com/391/

Ya, I've Seen That Before. It's Pretty Funny.

Offline

 

#658 2010-06-15 14:35:14

TheGameMaster1231
Scratcher
Registered: 2009-07-24
Posts: 1000+

Re: Cool custom blocks in Scratch

LS97 wrote:

i mean billybob's post.

BillyBob Was Talking About My Signature. (See The Italic-Bold-Underlined Words? Good.)

Last edited by TheGameMaster1231 (2010-06-15 14:35:27)

Offline

 

#659 2010-06-15 14:38:25

Joeman592
Scratcher
Registered: 2010-01-23
Posts: 100+

Re: Cool custom blocks in Scratch

no one asks about blocks anymore. Any new ones? a new catagory lesson would be great too, please.

Last edited by Joeman592 (2010-06-15 14:40:21)


http://i.imgur.com/HcAj1.png
http://i.imgur.com/gss7S.gifhttp://i.imgur.com/kbcKt.gifhttp://i.imgur.com/0LteM.gif

Offline

 

#660 2010-06-15 14:43:25

Joeman592
Scratcher
Registered: 2010-01-23
Posts: 100+

Re: Cool custom blocks in Scratch

a little of-topic: does anyone know when 2.0 is coming out?


http://i.imgur.com/HcAj1.png
http://i.imgur.com/gss7S.gifhttp://i.imgur.com/kbcKt.gifhttp://i.imgur.com/0LteM.gif

Offline

 

#661 2010-06-15 14:46:23

coka
Scratcher
Registered: 2007-11-03
Posts: 1000+

Re: Cool custom blocks in Scratch

I'm a newbie at this, but I want to learn it a little and play around with it. I don't know if this question has been answered in the 27 pages of this topic, but my words are in blue

LS97 wrote:

The 'Get time/date' block
http://www.freeimagehosting.net/uploads/209a5b329a.gif
Here we go!
The get time/date block reports the time, date, hour, etc. without the user having to insert it manually.
Okay. I am doing this to do a test to see if it actually works

Copy this line of code into a space between two blocks in the 'control' section of blockSpecs in ScriptableScratchMorph.

Code:

 ('get %s' #r #getTime: 'date')

I did, but then it asked for my initials. I typed my initials, and then it posted my initials and the date where I pasted this code.

Then go to the instance section, then to 'other ops' and replace the code of broadcast: with the following

Code:

getTime: t1 
    t1 = 'date' ifTrue: [^ Date today].
    t1 = 'short date' ifTrue: [^ Date today printFormat: #(1 2 3 $- 2 2 )].
    t1 = 'time' ifTrue: [^ Time now].
    t1 = 'seconds' ifTrue: [^ Time now seconds].
    t1 = 'minutes' ifTrue: [^ Time now minutes].
    t1 = 'hours' ifTrue: [^ Time now hours].
    t1 = 'day' ifTrue: [^ Date today weekday].
    t1 = 'help' ifTrue: [^ 'type date, short date, time, seconds, minutes, day, hours'].
    ^ 'Error!'

then right-click and click accept. type your initials and you're ready to use the new block!

I don't know if I did all of it right, but I just don't know what to do next...
Thanks!
~coka
-----
@ Joeman592: Scratch 2.0 is supposed come out sometime in early to mid-2011

Last edited by coka (2010-06-15 14:50:59)


http://i42.tinypic.com/2rot8c2.png

Offline

 

#662 2010-06-15 14:59:18

Joeman592
Scratcher
Registered: 2010-01-23
Posts: 100+

Re: Cool custom blocks in Scratch

coka wrote:

I'm a newbie at this, but I want to learn it a little and play around with it. I don't know if this question has been answered in the 27 pages of this topic, but my words are in blue

LS97 wrote:

The 'Get time/date' block
http://www.freeimagehosting.net/uploads/209a5b329a.gif
Here we go!
The get time/date block reports the time, date, hour, etc. without the user having to insert it manually.
Okay. I am doing this to do a test to see if it actually works

Copy this line of code into a space between two blocks in the 'control' section of blockSpecs in ScriptableScratchMorph.

Code:

 ('get %s' #r #getTime: 'date')

I did, but then it asked for my initials. I typed my initials, and then it posted my initials and the date where I pasted this code.

Then go to the instance section, then to 'other ops' and replace the code of broadcast: with the following

Code:

getTime: t1 
    t1 = 'date' ifTrue: [^ Date today].
    t1 = 'short date' ifTrue: [^ Date today printFormat: #(1 2 3 $- 2 2 )].
    t1 = 'time' ifTrue: [^ Time now].
    t1 = 'seconds' ifTrue: [^ Time now seconds].
    t1 = 'minutes' ifTrue: [^ Time now minutes].
    t1 = 'hours' ifTrue: [^ Time now hours].
    t1 = 'day' ifTrue: [^ Date today weekday].
    t1 = 'help' ifTrue: [^ 'type date, short date, time, seconds, minutes, day, hours'].
    ^ 'Error!'

then right-click and click accept. type your initials and you're ready to use the new block!

I don't know if I did all of it right, but I just don't know what to do next...
Thanks!
~coka
-----
@ Joeman592: Scratch 2.0 is supposed come out sometime in early to mid-2011

it is alt-v to paste, not ctrl-v


http://i.imgur.com/HcAj1.png
http://i.imgur.com/gss7S.gifhttp://i.imgur.com/kbcKt.gifhttp://i.imgur.com/0LteM.gif

Offline

 

#663 2010-06-15 15:33:27

coka
Scratcher
Registered: 2007-11-03
Posts: 1000+

Re: Cool custom blocks in Scratch

joeman592 wrote:

it is alt-v to paste, not ctrl-v

Thanks a lot!  wink  I'm so used to ctrl-v  tongue

Last edited by coka (2010-06-15 15:33:59)


http://i42.tinypic.com/2rot8c2.png

Offline

 

#664 2010-06-15 19:09:23

stickdude123
Scratcher
Registered: 2010-05-31
Posts: 100+

Re: Cool custom blocks in Scratch

LS97 wrote:

Hey Scratchers!
Are you all wondering how to make your own blocks in Scratch using Squeak? Well then, you've come to the right place. This forum thread will include tutorials, links to other projects, and more to make blocks like this:

http://www.freeimagehosting.net/uploads/ef0a230720.gif

The blocks are pretty much self-explanatory, so no need for a list of what they do. i'll start with the block-making right away.

Note for the lazy people: this tutorial aims to teach people to work in Squeak, not only to get the new blocks. So do not ask for my image file.

First, we have to open the system browser. Here's a tutorial for it:
T - Open Browser

Now, we're ready to start programming. From the browser, go to:
>Scratch-Objects
>ScriptableScratchMorph
>Click onto Class
>Scratch (or) BlockSpecs
>blockSpecks

Here we've got the main bit of blocks. it all looks very messy, so you can use the find option if you want to save your eyes when looking for a block. Now let's take a block to analize: the yellow repeat(X) block.
http://www.freeimagehosting.net/uploads/fb29012635.png
See how i highlighted a bit? that's the code for that block.
The block coding structure is as follows:

('repeat %n' #c #doRepeat 10)
the block is identified by the two brackets (blue).
the block text is in between apostrophes (black).
the block type identifier or block arguments follow a # sign (red).
the command also follows a # sign (green).

the %n in the block is the input box, where the user can put the number. in fact, %n produces that round textbox where only numbers can be inserted. here's the full list:

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 billyedward for this list.

the repeat block, having to 'host' other blocks in it, is C shaped. that's why the block argument (above in red) is a c.
Here's a brief list of the different arguments:

Code:

#-   no arguments (command 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
#S   start button click hat block
#K   key-activated hat block

There's many more types of hat blocks, but i won't include them all.

but it's not all that simple! now that we've got the block in the block palette, we need to give it the code it needs to perform the action. for this you need to go to 'instance', then to the appropriate 'ops'. there, after creating a method, you can add the code you need.
________
Now that you know a bit about the structure, we can move on quickly to the actual new blocks you saw at the beginning. I'm not going to add them into this post, it would be too long. you'll find the different blocks in different posts.
I hope you'll enjoy your new blocks!

he is so right how can i do it its hard for me!


http://internetometer.com/imagesmall/34259.png http://www.mediafire.com/convkey/418e/lkb7wmv2n2k73rz5g.jpg         http://blocks.scratchr.org/API.php?user=stickdude123&action=onlineStatus&type=square

Offline

 

#665 2010-06-15 21:04:24

Joeman592
Scratcher
Registered: 2010-01-23
Posts: 100+

Re: Cool custom blocks in Scratch

any new blocks at all?


http://i.imgur.com/HcAj1.png
http://i.imgur.com/gss7S.gifhttp://i.imgur.com/kbcKt.gifhttp://i.imgur.com/0LteM.gif

Offline

 

#666 2010-06-16 01:39:01

wei2912
Scratcher
Registered: 2010-05-09
Posts: 100+

Re: Cool custom blocks in Scratch

Can someone show me where to put the code of the link block? I can't find where to put it.


Waiting for Scratch 2.0...

Offline

 

#667 2010-06-16 01:54:49

ScratchReallyROCKS
Scratcher
Registered: 2009-04-22
Posts: 1000+

Re: Cool custom blocks in Scratch

wei2912 wrote:

Can someone show me where to put the code of the link block? I can't find where to put it.

I'd put in in the 'other ops' section of 'ScriptableScratchMorph.'


http://imageshack.us/a/img694/3806/sigmad.png

Offline

 

#668 2010-06-16 02:13:59

wei2912
Scratcher
Registered: 2010-05-09
Posts: 100+

Re: Cool custom blocks in Scratch

ScratchReallyROCKS wrote:

wei2912 wrote:

Can someone show me where to put the code of the link block? I can't find where to put it.

I'd put in in the 'other ops' section of 'ScriptableScratchMorph.'

Thanks.


Waiting for Scratch 2.0...

Offline

 

#669 2010-06-16 07:39:58

da123
Scratcher
Registered: 2010-01-15
Posts: 35

Re: Cool custom blocks in Scratch

Joeman592 wrote:

any new blocks at all?

I'm sure LS97 will get around to that soon. I want more blocks too!

Offline

 

#670 2010-06-16 11:59:39

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Cool custom blocks in Scratch

If you want any new blocks, you need to give me IDEAS for them!

Offline

 

#671 2010-06-16 12:02:03

Joeman592
Scratcher
Registered: 2010-01-23
Posts: 100+

Re: Cool custom blocks in Scratch

how about... a previous costume block?


http://i.imgur.com/HcAj1.png
http://i.imgur.com/gss7S.gifhttp://i.imgur.com/kbcKt.gifhttp://i.imgur.com/0LteM.gif

Offline

 

#672 2010-06-16 12:16:58

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Cool custom blocks in Scratch

Joeman592 wrote:

how about... a previous costume block?

no use. just do a
[blocks]<switch to costume[ (( <costume#> <-> 1 ))

Offline

 

#673 2010-06-16 12:37:32

Joeman592
Scratcher
Registered: 2010-01-23
Posts: 100+

Re: Cool custom blocks in Scratch

LS97 wrote:

Joeman592 wrote:

how about... a previous costume block?

no use. just do a
[blocks]<switch to costume[ (( <costume#> <-> 1 ))

come on, please?


http://i.imgur.com/HcAj1.png
http://i.imgur.com/gss7S.gifhttp://i.imgur.com/kbcKt.gifhttp://i.imgur.com/0LteM.gif

Offline

 

#674 2010-06-16 13:27:41

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Cool custom blocks in Scratch

no. it's easy to make in scratch!

Offline

 

#675 2010-06-16 14:38:57

scratchisthebest
Scratcher
Registered: 2009-02-08
Posts: 500+

Re: Cool custom blocks in Scratch

I need help. My new (key pressed) block gets an error, and my <key [space] pressed> block works like my modblock was supposed to!

Can someone help me? I don't do Squeak.


bye 1.4, we all loved you. but we all outgrew the site. 2.0 is a welcome change.
http://scratch.mit.edu/img/Pico3-med.pnghttp://scratch.mit.edu/img/Pico3-med.pnghttp://scratch.mit.edu/img/Pico3-med.pnghttp://scratch.mit.edu/img/Pico3-med.pnghttp://scratch.mit.edu/img/Pico3-med.png

Offline

 

Board footer