Hardmath123 wrote:
I'm relatively new at this, so here's my first block:
Code:
('pi' #r #pi)Code:
pi ^ 3.141592653Pretty simple, you don't have to add it if you don't want to.
Hey, I made that same block!
Offline
I have three more blocks to be added to the list:
<beep>
[blockspec] ('beep' - doBeep)
doBeep self beep
<showing?>
[blockspec] ('showing?' #b #getHidden)
getHidden self isHidden = false ifTrue: [^ true]. ^ false
<save stage area to sprite>
[blockspec] ('save stage area to sprite' #- #grabFromScreen)
no code is needed
All by LS97
Last edited by Marioblender (2010-11-07 20:11:14)
Offline
Marioblender wrote:
I have three more blocks to be added to the list:
<beep>
[blockspec] ('beep' - doBeep)Code:
doBeep self beep<showing?>
[blockspec] ('showing?' #b #getHidden)Code:
getHidden self isHidden = false ifTrue: [^ true]. ^ false<save stage area to sprite>
https://lh4.googleusercontent.com/HL1M9 … WwqyA=s512
[blockspec] ('save stage area to sprite' #- #grabFromScreen)
no code is needed
Did you get the 'save stage area to sprite' from LS97's post? It is the exact same. I don't think it is fair to post it without credit.
Edit: Hey... The showing block is from there too! I'm not trying to be mean but don't steal blocks from people.
Last edited by sonicjosh (2010-11-03 03:44:23)
Offline
Error: sometimes people use source, and some do not. This can get blockspecs tied up. Mark the blockspecs source and non-source.
Blockspec for the (report () ) block in each code:
non-source: ('report %s' #r #report:)
source: ('report %s' r report:)
I use non-source.
Offline
sparks wrote:
I could add a link to This site, it has a load of alt codes, but not only do alt codes not work on macs, special characters are rarlely needed for blocks....
That would work, if you think it a good idea.
Offline
Code:
('Spawn Variable' #- #addGlobalVariable)Code:
no code needed
Makes a new variable.
Last edited by Hardmath123 (2010-11-04 11:28:04)
Offline
Code:
('%b' #r #booleanstring:) ('%s' #b #booleanstring:)Code:
booleanstring: t1 ^ t1
my first script with variables.
Converts booleans to strings and vice-versa.
Last edited by Hardmath123 (2010-11-18 08:47:51)
Offline
This site is good for extra characters
Offline
More...
Code:
('%b is the same value as %b' #b #same:test:)Code:
same: t1 test: t2 t1 = t2 ifTrue: [^ true]. ^ false
tells whether or not the two booleans are the same.
My first block with "if".
P.S. I technically do not know squeak, I am deriving the codes from the already-there programs.
Offline
Last one today:
Code:
('Comment from maker:%s' #- #falsetest: #commenthere)Code:
falsetest: t1 ^ t1
lets one insert comments. Experimenting with default settings...
Offline
Marioblender wrote:
<showing?>
[blockspec] ('showing?' #b #getHidden)Code:
getHidden self isHidden = false ifTrue: [^ true]. ^ false
Optimisation
getHidden ^ self isHidden not
Offline
Marioblender wrote:
Code:
getHidden self isHidden = false ifTrue: [^ true]. ^ false
Optimized, you get this:
getHidden ^self isHidden not
For even more optimization, use this blockspec:
('I am hidden?' #b #isHidden)
Offline
Shared by HD123
Blockspec:
('point towards x:%n y:%n' #- #pointToX:y: 0 0)
no code needed
What it does:
This block will make any sprite point toward a certain coordinate, specified by the user.
Offline
you know, I think that in the next scratch there should be only one hat block, which would be: _________
/ \___________
| When < >___________|
\_/
and then all the other hat blocks would be condensed into Boolean.
for example, to use [blocks]<when green flag clicked>[/blocks]
you would put a <Green Flag Clicked?> Boolean into the only hat block.
Offline
chippo wrote:
you know, I think that in the next scratch there should be only one hat block, which would be: _________
/ \___________
| When < >___________|
\_/
and then all the other hat blocks would be condensed into Boolean.
for example, to use [blocks]<when green flag clicked>[/blocks]
you would put a <Green Flag Clicked?> Boolean into the only hat block.
That would be cool! Have you posted it in the Suggestions forum yet?
Offline
Double posting I know, but I just made a block that works!!!!! Here's a picture:
It makes the sprite glide to another sprite. But, you have to type the correct name in.
And, of course, the programming!
(The "sprite" input is an Any Type. Text doesn't work for me.)
Offline
what about a transition to costume [costume2^] over (2) secs in looks
i dont know how to code, sorry
here is how it will look and work http://scratch.mit.edu/projects/scimonster/1334438
i made this using paint editor and it works with 2 sprites and ghost effect
Edit: i might have the blockspecs
('transition to costume %l over %n secs' #r #TransToCostume)
Last edited by scimonster (2010-12-07 06:35:31)
Offline