It looks like the [wait untill < >] block
Offline
TheSuccessor wrote:
Pecola1 wrote:
Does it work on another sprite?
Yes!
LOL I seriously did that on RKT compares IMG but didn't try testing it, then forgot to save it AND forgot where it was.
Offline
How do you get to the ScriptableScratchMorph?
Offline
rubiks_cube_guy238 wrote:
Okay. Go to Scratch-Blocks->WhenHatBlockMorph and add two new methods in the instance side:
stepTime
^ 0.1and
step
self evaluateCondition ifTrue: [self start]Now add a new block in the ScriptableScratchMorph blockSpecs:
('' #W #-)
(We don't give the block a name because the WhenHatBlockMorph class automatically adds the label.)
Finally, go to ScriptableScratchMorph->blockFromTuple:receiver: and delete the text that says(t6 isKindOf: WhenHatBlockMorph) ifTrue: [t6 color: Color red].
It's that easy!
![]()
BUG FIX: The block won't work if you switch to another sprite or switch to presentation mode. To fix this, go back to WhenHatBlockMorph and delete the #step and #stepTime methods. Now, go to ScriptableScratchMorph step:step
blocksBin
submorphsDo: [:each | (each isKindOf: WhenHatBlockMorph)
ifTrue: [each evaluateCondition ifTrue: [each start]]].
costume mediaStep ifTrue: [self costumeChanged]Credit to MathWizz for the bug fix.
FURTHER BUG FIX: This isn't exactly a bug fix, but it's simpler. Copy the following code:Code:
!ScratchFrameMorph methodsFor: 'stepping'! processWhenConditions | t1 | "true ifTrue: [^ self]." t1 _ workPane submorphs select: [:t2 | t2 isKindOf: ScriptableScratchMorph]. t1 _ t1 copyWith: workPane. t1 do: [:t3 | t3 scripts do: [:t4 | (t4 isMemberOf: WhenHatBlockMorph) ifTrue: [(t4 hasRunningProcess not and: [t4 evaluateCondition]) ifTrue: [t4 start; layoutChanged]]]]! ! !ScratchPresenterMorph methodsFor: 'event handling'! processWhenConditions | t1 | "true ifTrue: [^ self]." t1 _ stage submorphs select: [:t2 | t2 isKindOf: ScriptableScratchMorph]. t1 _ t1 copyWith: stage. t1 do: [:t3 | t3 scripts do: [:t4 | (t4 isMemberOf: WhenHatBlockMorph) ifTrue: [(t4 hasRunningProcess not and: [t4 evaluateCondition]) ifTrue: [t4 start; layoutChanged]]]]! !paste it in a workspace (you find the option on the open browser menu), highlight it, right-click, 'more...', 'file it in'.
Credit to TheSuccessor.
Can you make it in a Scratch Mod?


Offline