rubiks_cube_guy238 wrote:
rubiks_cube_guy238 wrote:
Billybob-Mario wrote:
I'm trying to make a block from blockspecs block (in Slash, based on BYOB, so it's possible without major messing)
My not working code is:Code:
blockSpecsBlock: t1 ^ self blockFromSpec: t1 color: (ScriptableScratchMorph blockColorFor: 'more')What's wrong?
If nothing is wrong, what should I put in for the input as opposed to the normal blockspecs.I know what's wrong. Change the code to this:
Code:
blockSpecsBlock: t1 ^ self blockFromSpec: (ScriptableScratchMorph parseCommandSpec: t1) color: (ScriptableScratchMorph blockColorFor: 'more')I'm sorry, it should be
Code:
blockSpecsBlock: t1 ^ self blockFromSpec: (CommandBlockMorph parseCommandSpec: t1) color: (ScriptableScratchMorph blockColorFor: 'more')
It still doesn't work.
Offline
TheSuccessor wrote:
Bump post 5.
Offline
New blocks:
pause:
Add an instance variable to ScratchProcess called isPaused.
in ScratchProcess:
doPause
isPaused _ true.
self pushStackFrame: (ScratchStackFrame new shouldYield: true)play:
in ScratchProcess:
isPaused
^ isPausedin ScriptableScratchMorph:
doPlay
| t1 |
t1 _ ScratchProcess allInstances select: [:t2 | t2 isPaused == true].
t1 do: [:t3 | t3 popStackFrame]Feel free to use these, but give me credit.
Last edited by TheSuccessor (2010-10-08 16:06:47)
Offline
TheSuccessor wrote:
New blocks:
pause:
Add an instance variable to ScratchProcess called isPaused.
in ScratchProcess:Code:
doPause isPaused _ true. self pushStackFrame: (ScratchStackFrame new shouldYield: true)play:
in ScriptableScratchMorph:Code:
doPlay | t1 | t1 _ ScratchProcess allInstances select: [:t2 | t2 isPaused == true]. t1 do: [:t3 | t3 popStackFrame]Feel free to use these, but give me credit.
Whats the block spec
Offline
('pause' #s #doPause)
('play' #- #doPlay)
Offline
johnnydean1 wrote:
TheSuccessor wrote:
New blocks:
pause:
Add an instance variable to ScratchProcess called isPaused.
in ScratchProcess:Code:
doPause isPaused _ true. self pushStackFrame: (ScratchStackFrame new shouldYield: true)play:
in ScriptableScratchMorph:Code:
doPlay | t1 | t1 _ ScratchProcess allInstances select: [:t2 | t2 isPaused == true]. t1 do: [:t3 | t3 popStackFrame]Feel free to use these, but give me credit.
Whats the block spec
what kind of ScratchProcces? What kind of scriptable scratch morph?

kinker style! [url]
[/url]♬♫ 92% of teens have moved on to rap. If you are part of the 8% who still listen to real music, copy and paste this into your signature. ♫♪Offline
Billybob-Mario wrote:
rubiks_cube_guy238 wrote:
rubiks_cube_guy238 wrote:
I know what's wrong. Change the code to this:Code:
blockSpecsBlock: t1 ^ self blockFromSpec: (ScriptableScratchMorph parseCommandSpec: t1) color: (ScriptableScratchMorph blockColorFor: 'more')I'm sorry, it should be
Code:
blockSpecsBlock: t1 ^ self blockFromSpec: (CommandBlockMorph parseCommandSpec: t1) color: (ScriptableScratchMorph blockColorFor: 'more')It still doesn't work.
Anyone?
Offline
kinker wrote:
johnnydean1 wrote:
TheSuccessor wrote:
New blocks:
pause:
Add an instance variable to ScratchProcess called isPaused.
in ScratchProcess:Code:
doPause isPaused _ true. self pushStackFrame: (ScratchStackFrame new shouldYield: true)play:
in ScriptableScratchMorph:Code:
doPlay | t1 | t1 _ ScratchProcess allInstances select: [:t2 | t2 isPaused == true]. t1 do: [:t3 | t3 popStackFrame]Feel free to use these, but give me credit.
Whats the block spec
what kind of ScratchProcces? What kind of scriptable scratch morph?
Open browser, Scratch-Execution Engine, ScratchProcess
Offline
kinker wrote:
johnnydean1 wrote:
TheSuccessor wrote:
New blocks:
pause:
Add an instance variable to ScratchProcess called isPaused.
in ScratchProcess:Code:
doPause isPaused _ true. self pushStackFrame: (ScratchStackFrame new shouldYield: true)play:
in ScriptableScratchMorph:Code:
doPlay | t1 | t1 _ ScratchProcess allInstances select: [:t2 | t2 isPaused == true]. t1 do: [:t3 | t3 popStackFrame]Feel free to use these, but give me credit.
Whats the block spec
what kind of ScratchProcces? What kind of scriptable scratch morph?
- ScriptableScratchMorph: The area where you can place blocks. For both Sprite and Stage. Others, like the Sprite one and the Stage one, where block specs are there, are only for a single sprite or the stage, depending on which one you've come to.
Offline
Can I put these in my tutorial mod? (Sizzle)
Offline