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

#1 2010-11-15 08:56:45

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

E block?

What's the blockspec for a block like

[blocks]
<if>


<else>


<end>
[/blocks]

?

Last edited by Hardmath123 (2010-11-15 08:58:17)


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

Offline

 

#2 2010-11-15 12:03:29

TheSuccessor
Scratcher
Registered: 2010-04-23
Posts: 1000+

Re: E block?

The blockspec is #c, the same as for a block like
[blocks]<forever>
<end>[/blocks]
You need to modify the blockFromSpec:color: method to give IfElseBlockMorphs for your blockspec. You also need to modify IfElseBlockMorph to put the correct label on.

Last edited by TheSuccessor (2010-11-15 12:03:48)


/* No comment */

Offline

 

#3 2010-11-17 06:30:18

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

Re: E block?

How about 3 holes?

Or a flat-bottom like the forever or stop all?

[blocks]<forever><stop all>[/blocks]

Last edited by Hardmath123 (2010-11-17 06:31:44)


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

Offline

 

#4 2010-11-17 11:37:02

TheSuccessor
Scratcher
Registered: 2010-04-23
Posts: 1000+

Re: E block?

For a flat bottom you need to modify CommandBlockMorph's isStop method. For three holes, you need to create a new subclass of CommandBlockMorph and program the graphics yourself.


/* No comment */

Offline

 

#5 2010-11-17 21:00:36

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

Re: E block?

I wish the scratch team would think of C-Shapes like inputs instead of block types, like in BYOB. Instead of (' ' #c #ifElse) you could do something more along the lines of ('If %c el if %c else %c' #- #ifElseElfif)


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

Offline

 

#6 2010-11-20 02:45:30

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

Re: E block?

midnightleopard wrote:

I wish the scratch team would think of C-Shapes like inputs instead of block types, like in BYOB. Instead of (' ' #c #ifElse) you could do something more along the lines of ('If %c el if %c else %c' #- #ifElseElfif)

That's a great idea! You should officially suggest it.

Then you could make blocks like:

[blocks]
<forever>
<if>
<else>
<end>
[/blocks]

etcetera

Last edited by Hardmath123 (2010-11-20 02:45:48)


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

Offline

 

#7 2010-11-22 11:51:51

TheSuccessor
Scratcher
Registered: 2010-04-23
Posts: 1000+

Re: E block?


/* No comment */

Offline

 

Board footer