Greenatic wrote:
WingsGames wrote:
I have a suggestion: a "set answer to" block.
That should be pretty simple. However, the purpose of the (answer) value is to represent user input, not a variable value.
Yes, but without it, if the user entered their password using the the < password for () is () > block, it would be stored in the answer variable until they typed in something else.
Offline
Splodgey wrote:
Greenatic wrote:
Splodgey wrote:
Are you talking about my block? Because if you are does that mean I submitted it correctly?No, he was referring to lu9.
700TH POST!!!DID I submit it correctly? If not how do I submit it correctly?
For scratch and panther. use this syntax:
image of block (with no inputs) - if you are a new scratcher, just post the url and ask someone else to add the [img] tags
blockspec:
the blockspec in a code tag
code:
the code in a code tag
For BYOB:
image of block (with no inputs)
image of the scripts
Offline
zippynk wrote:
Greenatic wrote:
WingsGames wrote:
I have a suggestion: a "set answer to" block.
That should be pretty simple. However, the purpose of the (answer) value is to represent user input, not a variable value.
Yes, but without it, if the user entered their password using the the < password for () is () > block, it would be stored in the answer variable until they typed in something else.
Yep. That is a good idea.
Offline
(Requested)
('set answer to %s' #- #setAnswerTo:)
ScriptableScratchMorph > sensing ops
setAnswerTo: t1 ScratchPrompterMorph setAnswer: t1
ScratchPrompterMorph > class > accessing
Make a new method:
setAnswer: t1 LastAnswer _ t1
Last edited by Greenatic (2011-12-17 10:45:27)
Offline
I have a suggestion for a block in the sensing category:
<Coordinates x: ( ) y: ( ) touching color [ ]>
it would be able to fit into the < > fields and would be useful for platformer sensing in combination with the (min x), (min y), (max x), and (max y) blocks.
Thanks!
Offline
Nireckda815 wrote:
I have a suggestion for a block in the sensing category:
<Coordinates x: ( ) y: ( ) touching color [ ]>
it would be able to fit into the < > fields and would be useful for platformer sensing in combination with the (min x), (min y), (max x), and (max y) blocks.
Thanks!
Hmm, I made some code for that that should work, but the Array is causing problems. Oh well.
Offline
you can do that so easily in panther. Just do
<(!colour of pixel at x:() y:()! as string) = (!colour you are testing for! as string)>
Offline
When are we getting an update done around here?
I'm way too busy to do one.
Offline
joefarebrother wrote:
you can do that so easily in panther. Just do
<(!colour of pixel at x:() y:()! as string) = (!colour you are testing for! as string)>
I was thinking the same thing, only touching would mean having any of the pixels AROUND it as well.
Offline
Nireckda815 wrote:
I have a suggestion for a block in the sensing category:
<Coordinates x: ( ) y: ( ) touching color [ ]>
it would be able to fit into the < > fields and would be useful for platformer sensing in combination with the (min x), (min y), (max x), and (max y) blocks.
Thanks!
OK, here's the code:
(Requested)
(coordinates x:%n y:%n touching color %c?' #b #X:y:touching:)
X: t1 y: t2 touching: t3 |t4 | t4 _ #() asOrderedCollection. t1 isInf | t1 isNaN | t2 isInf | t2 isNaN ifTrue: [^ false]. #((1 -1) (1 0) (1 1) (0 1) (-1 1) (-1 0) (-1 -1) (0 -1) ) do: [:t5 | t4 add: ScratchOrigin + ((t5 at: 1) @ (t5 at: 2)) + (t1 rounded @ t2 rounded)]. t4 do: [:t6 | t6 x > (ScratchOrigin x + 240) ifTrue: [t6 _ ScratchOrigin x + 240 @ t6 y]. t6 x < (ScratchOrigin x - 240) ifTrue: [t6 _ ScratchOrigin x - 240 @ t6 y]. t6 y > (ScratchOrigin y + 180) ifTrue: [t6 _ t6 x @ (ScratchOrigin y + 180)]. t6 y < (ScratchOrigin y - 180) ifTrue: [t6 _ t6 x @ (ScratchOrigin y - 180)]]. t4 do: [:t7 | (Display colorAt: t7) = t3 ifTrue: [^ true]. nil]. ^ false
Last edited by Greenatic (2011-12-17 10:45:41)
Offline
OK, I know I made it a while ago, but my "About Me" page is now linked to in the library post!
EDIT: Wait, should I add the list of available dropdowns too?
EDIT2: How many blocks do you all think need to be in an update for that update to be worthwhile?
Last edited by Greenatic (2011-12-14 19:20:04)
Offline
scimonster wrote:
When are we getting an update done around here?
I'm way too busy to do one.
Yeah, I don't think an update has been done since page 72.
I'm going to try to free up some time. No guarantees, though.
Offline
Can I request a panther block? It is called
|floodfill at x: () y: () in colour ! !|
and it will be in the pen catogary.
If colours were in BYOB, I would use a script like
Can someone convert that to smalltalk for me?
Also, all of those set blocks give me an idea for a new block for BYOB. It uses 2 blocks from the BYOB tool sprite
The scripts are
and
(the version in the tool package is wrong)
The new block is
and the scripts are
An example of it would be this following script to draw a line:
Please add this, and please make my panther request. Thank you.
Last edited by joefarebrother (2011-12-16 11:27:43)
Offline
Panther block: update from [] with version []
This block performs an automatic update from the URL specified. The URL should point to a directory containing (at least) a file named version.txt, and a file named <first line of version.txt>.pt (the most recent version of the project). The second argument to the block specifies the current version of the project. If the user is using an outdated project (the version is not the same as the first line of version.txt), he/she is asked if he/she wants to download the new version. If so, the new version is downloaded, opened, and run.
(-) update from $String$ with version $String$
"Usage: provide a directory URL with version.txt and (first line of version.txt).pt" | version frame dir name stream | (t1 endsWith: '/') ifFalse: [t1 := t1, '/']. frame := ScratchFrameMorph allInstances first. version := (HTTPSocket httpGet: t1, 'version.txt') contents lines first. version = t2 ifTrue: [^ self]. (DialogBoxMorph ask: 'A new version (', version, ') is available. Would you like to download it?') ifFalse: [^ self]. name := frame projectName, '.pt'. (dir := frame projectDirectory) deleteFileNamed: name. stream := (dir newFileNamed: version, '.pt'). stream reset. stream nextPutAll: (HTTPSocket httpGet: t1, version, '.pt') contents. frame openScratchProjectNamed: dir pathName, dir slash, version, '.pt'; shoutGo.
Last edited by nXIII (2011-12-15 18:06:09)
Offline
('set Scratch interface font to %s' #- #UIFontTo:)
UIFontTo: t1 ((UnicodePlugin getFontList) includes: (t1 asString)) ifTrue:[ ScratchTranslator renderFont: t1. ScratchTranslator updateScratchUI]
ScratchTranslator > class > any category
Create new method:
renderFont: t1 RenderFont _ t1
Last edited by Greenatic (2011-12-17 10:46:21)
Offline
Has .BLOCK development frozen?
Last edited by Greenatic (2011-12-17 13:17:02)
Offline
Greenatic wrote:
Has .BLOCK development frozen?
Uh... I think so. XD
Offline
Pecola1 wrote:
Greenatic wrote:
Has .BLOCK development frozen?
Uh... I think so. XD
Darn.
*cue the trumpets* Update underway! Now let's hope I don't completely mess this up... And don't expect me to get through 16 pages of library today. That's not going to happen.
Last edited by Greenatic (2011-12-17 14:31:51)
Offline
@All librarians: I post all my block images on an old Webs account, but I would prefer, for the sake of organization, that I keep that for only my block images (I use this as a way to go back and figure out what blocks I made). Some people (no names to be mentioned!) didn't upload pictures, and I was never granted access to the weebly (I think). Could someone please upload and post links for the following blockspecs:
('%n is even?' #b #even:)
('a:%n b:%n c:%n is Pythagorean triplet?' #b #py: 3 4 5 th:ag:)
('if x: %n y: %n , go to x: %n y: %n' #- #ifx:y:gox:y: 0 0 10 10)
Offline
Here is a sound amplitude recorder and writer.(Sorry, it cannot replay the music)
<when green flag clicked>< delete (all) of [amp]><go to x -240 )y 0) <pen up><clear><set pen color to( 0)<point in direction( 0)<pen down><recorddb>
recorddb is:
<<forever><<repeat( 480)<set y to( <loudness>)<change x by(1)<add <loudness> to [amp]><end>>
<clear><pen up><go to x -240 )y 0)><pen down><end>>
Offline
ianidani wrote:
Here is a sound amplitude recorder and writer.(Sorry, it cannot replay the music)
<when green flag clicked>< delete (all) of [amp]><go to x -240) y 0) <pen up><clear><set pen color to( 0)<point in direction( 0)<pen down><recorddb>
recorddb is:
<forever><repeat( 480)<set y to(<loudness>)<change x by(1)<add <loudness> to [amp]><end>
<clear><pen up><go to x -240) y 0)><pen down><end>
Offline
ianidani wrote:
Here is a sound amplitude recorder and writer.(Sorry, it cannot replay the music)
[blocks]<when green flag clicked>< delete (all) of [amp]><go to x -240 )y 0) <pen up><clear><set pen color to( 0)<point in direction( 0)<pen down><recorddb>
recorddb is:
<<forever><<repeat( 480)<set y to( <loudness>)<change x by(1)<add <loudness> to [amp]><end>>
<clear><pen up><go to x -240 )y 0)><pen down><end>>[/blocks]
use new lines between blocks like this:
[blocks]<when green flag clicked>
< delete (all) of [amp]>
<go to x -240 )y 0)
<pen up>
<clear><set pen color to( 0)
<point in direction( 0)
<pen down>
<recorddb>
recorddb is:
<<forever>
<<repeat( 480)
<set y to( <loudness>)
<change x by(1)
<add <loudness> to [amp]>
<end>> [/blocks]
Oh, and please remember the
[blocks][/blocks]
tage when you use the blocks.
Last edited by joefarebrother (2011-12-17 16:41:24)
Offline
Scratch Blocks added: [0]
Shared by Greenatic
Shared by Greenatic
Shared by Greenatic
Shared by Greenatic
Shared by Greenatic
Shared by Greenatic
Shared by Greenatic
Shared by Greenatic
Improved by Greenatic
Shared by Greenatic
As of this update, Greenatic is now Top Scratch Blocks Contributor.
Update carried out by block librarian: Greenatic
________________________________________________________________________________
^home
^updates archive
Last edited by YourLocalBlockLib (2011-12-17 22:05:59)
Offline
YourLocalBlockLib wrote:
As of this update, Greenatic is now Top Scratch Blocks Contributor.
*applause*
Offline