frowned wrote:
set rotation center blockspecs:
('set rotation center %s' #- #setrotationcenter:)
set rotation center code:
setrotationcenter: t1
costume rotationCenter = t1syntax for usage:
"xpos@ypos"
also i will later post my sprite attachment blocks
The attach to and de-attach from blocks have already been made, why don't you check before posting a code.
Offline
I wrote:
Here's how (follow this pattern):
Code:
<selector name> | repeatclient | repeatclient _ <number of times it should repeat> self <selector name> + <repeatno: repeatclient>Code:
<selector name> + <repeatno: repeatclient> repeatclient = 0 ifTrue: [^ self]. <coding to be repeated> self <selector name> + <repeatno: repeatclient - 1>
Quoted from the block library
Last edited by Hardmath123 (2011-01-30 05:09:14)
Offline
isStop ^ selector = #doReturn | (selector = #stopAll #freeze)
see correction to my tutorial i posted later in the thread, the code above is incorrect it should be:
isStop ^ selector = #doReturn | (selector = #stopAll) | (selector = #freeze)
Offline
Hardmath123 wrote:
Freeze Scratch:
Code:
('freeze Scratch!' #- #freeze)Code:
freeze self freezeScratch-Blocks»CommandBlockMorph»all»isStop
replace coding with:Code:
isStop ^ selector = #doReturn | (selector = #stopAll #freeze)Please credit frowned (this post, in particular).
I figured out how to make a repeat code in Squeak!!!
Here's how (follow this pattern):Code:
<selector name> | repeatclient | repeatclient _ <number of times it should repeat> self <selector name> + <repeatno: repeatclient>Code:
<selector name> + <repeatno: repeatclient> repeatclient = 0 ifTrue: [^ self]. <coding to be repeated> self <selector name> + <repeatno: repeatclient - 1>
WOW! I never thought you could do that, now almost ALL of the BYOB blocks can be made!
Offline
<change x by(
Offline
You just type or paste in it at the bottom.
Offline
Click on the - in the top left and choose new category.
Offline
sparks wrote:
hmm, nXIII, you might want to look at this. I'm finding that after saving a project in panther 1.0, I can open but not import it :S
Panther only imports .sb at the moment. Rename the file to sb and it will work. (not good for panther in the long run though)
Offline
I'm having a problem. Sometimes, when I have the block to get code for panther blocks in a project, it will not save. Originally, I saved the project somehow. but now, every time I try to save with the block to import blocks then I get an error message, something like "unknown ScratchCommentMorph" and I have lost a lot of work this way before i figured it out :-(
I can't seem to duplicate this bug at the moment. Could be only when i have imported a project, or with lots of sprites or lists or new blocks, no idea.
Offline
for BYOB
Offline
I have a block to add.
This is a reporter block that returns the most recent broadcast.
Block spec: (Scratch-Objects>>ScriptableScratchMorph>>class>>block specs>>blockspecs - control)
('message' #r #lastMessage)
Scratch-Objects>>ScriptableScratchMorph
Add class variable LastMessage.
It might look like this:
Morph subclass: #ScriptableScratchMorph instanceVariableNames: 'objName vars lists blocksBin isClone media costume costumeChangeMSecs filterPack visibility volume tempoBPM sceneStates ' classVariableNames: 'BlockColorDict BlockSpecDict DefaultBackgroundForm DefaultSpriteForm DoubleSize Experimental LastMessage ListBlockColor MeowSound OldMeowPrefixReversed PopSound RandomGen Recorder ScratchOrigin TimerStartMSecs ' poolDictionaries: '' category: 'Scratch-Objects'
Scratch-Objects>>ScriptableScratchMorph>>Instance>>accessing
lastMessage ^ LastMessage
lastMessage: t1 LastMessage _ t1
Scratch-Objects>>ScriptableScratchMorph>>instance>>other ops>>broadcast:
broadcast: t1 self broadcast: t1 withArgument: 0. self lastMessage: t1
Scratch-Objects>>ScriptableScratchMorph>>instance>>other ops>>broadcast:withArgument:
broadcast: t1 withArgument: t2 | t3 | (t3 _ self ownerThatIsA: ScratchStageMorph) ifNotNil: [t3 broadcastEventNamed: t1 asString with: t2]. self lastMessage: t1
Scratch-Objects>>ScriptableScratchMorph>>class>>other>>isSpriteSpecificTarget:selector:
Add 'lastMessage' to the list. It should look like this:
isSpriteSpecificTarget: t1 selector: t2 | t3 | (t1 isKindOf: ScratchSpriteMorph) ifFalse: [^ false]. t3 _ t2 asString findAnySubStr: #('answer' 'key' 'Loud' 'lastMessage' 'mouse' 'sensor' 'soundLevel' 'tempo' 'timer' ) startingAt: 1. ^ t3 > t2 asString size
Last edited by hpotter134 (2011-01-30 09:25:12)
Offline
The sprite touching sprite block isn't working for mouse touching edge and vise-versa. it comes up error! (scratch)
also, that block won't show edge unless you go to Scratch-Blocks>>SpriteArgMorph>>event handling>>presentMenu and add
t2 = #sprite:touching: ifTrue: [t4 add: 'edge' localized asUTF8 action: #edge].
after
t2 = #touching: ifTrue: [t4 add: 'edge' localized asUTF8 action: #edge].
Last edited by scimonster (2011-01-30 12:44:11)
Offline
this is good, but having a blockstore would be better. just vote 3 votes at: http://suggest.scratch.mit.edu/forums/60449-suggestions/suggestions/1431893-block-store
Offline
scimonster wrote:
improved version of the search block:
spec:Code:
('%j %s' #- #doThis:on: 'google' 'scratch')method (sensing ops):
Code:
doThis: t1 on: t2 'google' = t1 ifTrue: [ScratchPlugin primOpenURL: 'http://www.google.com/#sclient=psy&hl=en&q=' , t2 , '&aq=f&aqi=g5&aql=&oq=&gs_rfai=&pbx=1&fp=ab5cdb1806fef4aa&safe=activet1']. 'yahoo' = t1 ifTrue: [ScratchPlugin primOpenURL: 'http://search.yahoo.com/search;_ylt=Aj.OqjGVrkBmY6mZqA_PSu.bvZx4?p=' , t2 , '&toggle=1&cop=mss&ei=UTF-8&fr=yfp-t-701']. 'scratch.mit.edu/' = t1 ifTrue: [ScratchPlugin primOpenURL: 'http://scratch.mit.edu/' , t2]. 'search scratch for' = t1 ifTrue: [ScratchPlugin primOpenURL: 'http://scratch.mit.edu/pages/results?cx=010101365770046705949:gg_q9cry0mq&cof=FORID:11&q=' , t2 , '&safe=active&sa=search']. 'IMDB' = t1 ifTrue: [ScratchPlugin primOpenURL: 'http://www.imdb.com/find?s=all&q=' , t2]. 'wikipedia search for' = t1 ifTrue: [ScratchPlugin primOpenURL: 'http://en.wikipedia.org/w/index.php?title=Special%3ASearch&redirs=0&search=' , t2 , '&fulltext=Search&ns0=1']. 'load' = t1 ifTrue: [^ 0]. ^ 0also put in sensing ops:
Code:
engineNames ^ #('google' 'yahoo' 'scratch.mit.edu/' 'search scratch for' 'wikipedia search for' 'IMDB' 'load' )then go to Scratch-Blocks -> CommandBlockMorph instance -> private -> uncoloredArgMorphFor:
add:Code:
$j = t2 ifTrue: [^ ChoiceArgMorph new getOptionsSelector: #engineNames; choice: 'google'].also searches wikipedia!
So, how do you do this exactly? im very interested.
Offline
Is there a "create .txt file of list _"?
Offline
I have a BYOB block. It says the blocks you put in the C-shape. http://www.megaupload.com/?d=IQ4AZX9K Section: Other
Offline
bbbeb wrote:
@MSDOS: Do not use rapidshare or megaupload. Only premium accounts work well there.
What do you mean?
Offline
Pecola1 wrote:
bbbeb wrote:
@MSDOS: Do not use rapidshare or megaupload. Only premium accounts work well there.
What do you mean?
There is a download timer and truckloads of ads.
Offline
Do you want me too make a thing for how to open the system browser for scratch?
I have a project you can link to also. How to open the System Browser to add blocks
Offline