I read the post by billyedward, but I still cant get it to work. I want to add a block that says "if touching {object} bounce"
This is the code, i got it from the block library but I have no idea how or where to add it.
Blockspec:
('if touching %m bounce' #- #bounceOffSprite:)
code:
bounceOffSprite: aName
| sprite oldDir |
sprite _ self coerceSpriteArg: aName.
(self touching: sprite)
ifFalse: [^ self].
oldDir _ self heading.
self pointTowards: sprite.
self turnRight: self heading - oldDir + 180.
[self touching: sprite]
whileTrue: [self forward: 1]
Offline
jslomba wrote:
you're a new scratcher, you can't post blocks yet.
he's not talking about the block images in posts. He's talking about adding the blocks to Scratch.
I assume you know how to get into the browser. The blockspec probably goes under scratchStageMorph >> class >> blocspec (if you can see other control blocks there then good, otherwise try ScriptableScratchMorph or ScratchSpriteMorph) and the code should go as a new addition to the instance of the same section. (I realise this explaination is really vague but I need to go in a sec, maybe someone else can clarify!)
Last edited by sparks (2011-05-12 17:13:16)
Offline
jslomba wrote:
you're a new scratcher, you can't post blocks yet.
New Scratchers can post block images. I used to do that a ton.
Offline
poemon1 wrote:
ok go to scratch objects -> scratch sprite morph class block specs blockspecs then under motion put the blockspec and under instance and motion ops put the code hope it works
![]()
dude, this is almost 3 months old.
Offline
jslomba wrote:
poemon1 wrote:
ok go to scratch objects -> scratch sprite morph class block specs blockspecs then under motion put the blockspec and under instance and motion ops put the code hope it works
![]()
dude, this is almost 3 months old.
oh i dont usally look at the date
Offline