This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2011-05-12 15:55:44

goodtime41
New Scratcher
Registered: 2011-04-11
Posts: 8

How to add blocks to scratch?????

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

 

#2 2011-05-12 16:35:31

jslomba
Scratcher
Registered: 2009-09-25
Posts: 1000+

Re: How to add blocks to scratch?????

you're a new scratcher, you can't post blocks yet.


the the the the the

Offline

 

#3 2011-05-12 17:11:37

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: How to add blocks to scratch?????

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)


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#4 2011-05-12 20:28:07

scratcher7_13
Scratcher
Registered: 2011-02-09
Posts: 1000+

Re: How to add blocks to scratch?????

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.


♫ 90% of teens can't do math. If you are one of the 40% of teens who can, copy and paste this into your signature. ♫♪
http://dl.dropbox.com/u/6273449/BlockLibraryTitle.pnghttp://i.imgur.com/mr9Hf.gif

Offline

 

#5 2011-07-26 13:13:12

jslomba
Scratcher
Registered: 2009-09-25
Posts: 1000+

Re: How to add blocks to scratch?????

jslomba wrote:

you're a new scratcher, you can't post blocks yet.

lol, I was such a n00b back then.


the the the the the

Offline

 

#6 2011-07-26 13:50:39

poemon1
Scratcher
Registered: 2011-01-12
Posts: 500+

Re: How to add blocks to scratch?????

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  smile


http://i47.tinypic.com/rrqe13.gif

Offline

 

#7 2011-07-26 13:51:23

jslomba
Scratcher
Registered: 2009-09-25
Posts: 1000+

Re: How to add blocks to scratch?????

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  smile

dude, this is almost 3 months old.


the the the the the

Offline

 

#8 2011-07-26 15:20:51

poemon1
Scratcher
Registered: 2011-01-12
Posts: 500+

Re: How to add blocks to scratch?????

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  smile

dude, this is almost 3 months old.

oh i dont usally look at the date


http://i47.tinypic.com/rrqe13.gif

Offline

 

Board footer