Looks
Shared by Jwosty
blockspec:
('say nothing' #- #sayNothing)
no code needed
Shared by sonicjosh
blockspec:
('paint new costume' #- #drawNewCostume)
no code needed
What it does:
Opens the paint editor and lets you paint a new sprite. Good for games where people want to choose their own avatars.
Shared by coupdegrace
blockspec:
('go forward %n layers' #- #goFwdByLayers: 1)
Code:
goFwdByLayers: t1
owner ifNil: [^ self].
self layer: (owner submorphs indexOf: self)
- t1 truncated
What it does:
Moves your sprite forward the specified amount of layers. Note: this can also be achieved by typing a negative number into the go back %n layers block
Shared by Pecola1
Click here for the 6 stage panning blocks.
What these blocks do:
Pan the stage background around.
Shared by Jens Mönig
blockspec:
('h flip' #- #hFlip)
Code:
hFlip
costume form: (self form flipBy: #horizontal centerAt: 0 @ 0).
self costumeChanged
What this block does:
Flips a sprite horizontally to give a mirror image costume.
Shared by owetre18, based on the above block
Blockspec:
('v flip' #- #vFlip)
Code:
vFlip
costume form: (self form flipBy: #vertical centerAt: 0 @ 0).
self costumeChanged
What this block does:
Flips a sprite vertically to give a mirror image costume.
Shared by Pecola1
blockspec:
('grab screen region for new sprite' #- #grabSpriteFromScreen)
Code:
no code needed
What it does:
Lets you grab a region of the screen to make a new sprite with.
Shared by Pecola1
blockspec:
('save picture of stage' #- #stageShot)
Code:
no code needed
What it does:
Lets you save a picture of the stage.
Shared by Pecola1
blockspec:
('grab a new costume from stage' #- #grabFromScreen)
Code:
no code needed
What it does:
Lets you grab a region of the screen to make a new costume.
Shared by Pecola1
blockspec:
('layer #' #r #layer)
Code:
layer
^ owner submorphs indexOf: self
What it does:
Reports the layer number of the sprite.
Shared by Pecola1
blockspec:
('go to layer %n' #- #layer:)
Code:
no code needed
What it does:
Moves the sprite to a new layer.
Shared by Pecola1
blockspec:
('name of costume # %n' #r #costumeNameFromNumber:)
Code:
no code needed
What it does:
Reports the name of the costume number.
Shared by Scratchycat123
blockspec:
('hidden?' #b #isHidden)
Code:
no code needed
Shared by Hardmath123
blockspec:
('Jump forward %n costumes' #- #nextCostume: 2)
Code:
nextCostume: t1
self costumeIndex: self costumeIndex + t1
Shared by jslomba and made with Scramble
blockspec:
('animate costumes %n to %n with %n seconds in between %n times' #- #Anmat:Anmat:Anmat:Anmat:)
Code:
Anmat: i1 Anmat: i2 Anmat: i3 Anmat: i4
| t1 |
i4
timesRepeat:
[self lookLike: 1 + self costumeIndex.
t1 _ self costumeIndex.
t1 = i2 ifTrue: [self lookLike: i1].
(Delay forSeconds: i3) wait]
Shared by Hardmath123 and made with Scramble, improved by Greenatic (This block may also be used with backgrounds.)
Blockspec:
('Number of costumes' #r #numOfCos)
Code:
numOfCos
"Made using Scramble by Hardmath123"
| t1 |
t1 _ 0.
media do: [:t2 | t2 isImage ifTrue: [t1 _ t1 + 1]].
^ t1
Shared by Hardmath123 and made with Scramble
Blockspec:
('Switch whether hidden or shown' #- #switchHide)
Code:
switchHide
"Made using Scramble by Hardmath123"
| t1|
t1 _ self isHidden.
t1 ifTrue: [
self show.
].
t1 ifFalse: [
self hide.
].
Shared by Hardmath123
Blockspec:
('Get the name of costume number %n ' #r #costumeNameFromNumber: 1)
Code:
no code needed
Shared by Hardmath123 and made with Scramble
Blockspec:
('Am I on %l ?' #b #onCostume:)
Code:
onCostume: i1
"Made using Scramble by Hardmath123"
| t2 t1|
t1 _ self costumeIndex.
t2 _ self costumeNameFromNumber:t1.
t2 = i1 ifTrue: [
^ true
].
t2 = i1 ifFalse: [
^ false
]
Shared by Baderous
Blockspec:
('height' #r #height)
Code:
no code needed
What this block does:
Reports the height of the sprite.
Shared by Baderous
Blockspec:
('width' #r #width)
Code:
no code needed
What this block does:
Reports the width of the sprite.
Shared by TuragaTreeko
Blockspec:
('area' #r #area)
Code:
area
^self height * self width
What this block does:
Reports the amount of pixels the sprite takes up.
Shared by Greenatic
Blockspec:
('perimeter' #r #perimeter)
Code:
perimeter
^ (2 * self height) + (2 * self width)
What this block does:
Reports the perimeter of the sprite.
^ Back to Scratch Blocks
^ Back to Contents
█ █ █ █ █ █ █ █
Last edited by YourLocalBlockLib (2011-12-17 14:49:08)
Offline