What's the blockspec for a block like
[blocks]
<if>
<else>
<end>
[/blocks]
?
Last edited by Hardmath123 (2010-11-15 08:58:17)
Offline
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)
Offline
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)
Offline
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.
Offline
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)
Offline
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)
Offline