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

#301 2010-05-13 10:55:05

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Cool custom blocks in Scratch

Catwalk923 wrote:

Oh, another question; how come it will not let me use a block like so: say [get [date]] Instead of saying the date, my sprite just says; Error!

that's simply because you didn't make the block well.

Catwalk923 wrote:

Block requests: A (Date) block, a (time) block, and a (day) block. You know, where they look like the (mouse x) block? So all it does is report what is in it and you can put it in the say [] block successfully. Basically, I want to be able to have my sprites announcing the date, time, and day.    Please make it!

i already made them all, combined into one block. and the (mouse x) block types are called reporters.

Offline

 

#302 2010-05-13 13:18:16

Catwalk923
Scratcher
Registered: 2010-01-30
Posts: 47

Re: Cool custom blocks in Scratch

LS97 wrote:

Catwalk923 wrote:

Oh, another question; how come it will not let me use a block like so: say [get [date]] Instead of saying the date, my sprite just says; Error!

that's simply because you didn't make the block well.

I used YOUR code! So, how do I fix YOUR code?


ılıll|̲̅̅●̲̅̅|̲̅̅=̲̅̅|̲̅̅●̲̅̅|llılı

Offline

 

#303 2010-05-13 14:53:42

TheSuccessor
Scratcher
Registered: 2010-04-23
Posts: 1000+

Re: Cool custom blocks in Scratch

Catwalk923 wrote:

LS97 wrote:

Catwalk923 wrote:

Oh, another question; how come it will not let me use a block like so: say [get [date]] Instead of saying the date, my sprite just says; Error!

that's simply because you didn't make the block well.

I used YOUR code! So, how do I fix YOUR code?

LS97's code works. It's your fault.


/* No comment */

Offline

 

#304 2010-05-13 15:02:15

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Cool custom blocks in Scratch

@catwalk923,

i see you've registered on bingo.

Offline

 

#305 2010-05-13 19:10:18

pyrodon
Scratcher
Registered: 2010-03-27
Posts: 6

Re: Cool custom blocks in Scratch

Hi LS97. I'm not sure how to use the <sprite _ touching sprite> block that you made. Could you please tell me where to put all the code? I tried in many places and I still get errors.

Also, does anyone know the codes for the following and where to put them?

If touching sprite_, bounce
flip
(report name of sprite)
clone
delete me

Thanks in advance!

Offline

 

#306 2010-05-13 21:30:39

Joeman592
Scratcher
Registered: 2010-01-23
Posts: 100+

Re: Cool custom blocks in Scratch

pyrodon wrote:

Hi LS97. I'm not sure how to use the <sprite _ touching sprite> block that you made. Could you please tell me where to put all the code? I tried in many places and I still get errors.

Also, does anyone know the codes for the following and where to put them?

If touching sprite_, bounce
flip
(report name of sprite)
clone
delete me

Thanks in advance!

delete me is ('delete me' #- #deleteMe)

Code:

deleteMe
    self delete

p.s. made code myself!

report sprite name is ('sprite name #r #spriteName)

Code:

spriteName
    ^ self objName

Last edited by Joeman592 (2010-05-13 22:51:23)


http://i.imgur.com/HcAj1.png
http://i.imgur.com/gss7S.gifhttp://i.imgur.com/kbcKt.gifhttp://i.imgur.com/0LteM.gif

Offline

 

#307 2010-05-13 21:42:14

Catwalk923
Scratcher
Registered: 2010-01-30
Posts: 47

Re: Cool custom blocks in Scratch

TheSuccessor wrote:

Catwalk923 wrote:

LS97 wrote:


that's simply because you didn't make the block well.

I used YOUR code! So, how do I fix YOUR code?

LS97's code works. It's your fault.

I followed LS97's code exactly. Would you mind telling me how it is my fault, then?


ılıll|̲̅̅●̲̅̅|̲̅̅=̲̅̅|̲̅̅●̲̅̅|llılı

Offline

 

#308 2010-05-13 21:44:24

Catwalk923
Scratcher
Registered: 2010-01-30
Posts: 47

Re: Cool custom blocks in Scratch

LS97 wrote:

@catwalk923,

i see you've registered on bingo.

Yeah, I thought it would be fun. So, what exactly am I supposed to do? It looks like I'm supposed to make projects using new blocks.


ılıll|̲̅̅●̲̅̅|̲̅̅=̲̅̅|̲̅̅●̲̅̅|llılı

Offline

 

#309 2010-05-14 05:00:43

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Cool custom blocks in Scratch

Catwalk923 wrote:

LS97 wrote:

@catwalk923,

i see you've registered on bingo.

Yeah, I thought it would be fun. So, what exactly am I supposed to do? It looks like I'm supposed to make projects using new blocks.

yeah. either make projects using the blocks on this forum thread and email them to me or wait until bingo is released.

Offline

 

#310 2010-05-14 12:01:30

comp500
Scratcher
Registered: 2010-01-08
Posts: 1000+

Re: Cool custom blocks in Scratch

Can i have:

create sprite [] run code
         (code)
<end>

With the spec?
It creates a sprite named[] and runs the code on it.
Comp500:)

Last edited by comp500 (2010-05-14 12:02:48)


800 posts! W00T! Oh sorry im not on a lot but at least i have 1000+ posts

Offline

 

#311 2010-05-14 12:23:03

Catwalk923
Scratcher
Registered: 2010-01-30
Posts: 47

Re: Cool custom blocks in Scratch

Um... I really WOULD like to know how to fix the get [date] block. I used your code, but I can't use the get [date] block to work! What do I do???


ılıll|̲̅̅●̲̅̅|̲̅̅=̲̅̅|̲̅̅●̲̅̅|llılı

Offline

 

#312 2010-05-14 14:30:47

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Cool custom blocks in Scratch

Catwalk923 wrote:

Um... I really WOULD like to know how to fix the get [date] block. I used your code, but I can't use the get [date] block to work! What do I do???

hmm... i tried it and figured it out. i programmed it to report 'Error!' if the string entered did not match any of the options. if there had been a real error, it would have reported blank. so try entering 'help' after the (get[ bit. no spaces or punctuation!

see if that helps

Offline

 

#313 2010-05-14 17:44:48

pyrodon
Scratcher
Registered: 2010-03-27
Posts: 6

Re: Cool custom blocks in Scratch

Joeman592 wrote:

pyrodon wrote:

Hi LS97. I'm not sure how to use the <sprite _ touching sprite> block that you made. Could you please tell me where to put all the code? I tried in many places and I still get errors.

Also, does anyone know the codes for the following and where to put them?

If touching sprite_, bounce
flip
(report name of sprite)
clone
delete me

Thanks in advance!

delete me is ('delete me' #- #deleteMe)

Code:

deleteMe
    self delete

p.s. made code myself!

report sprite name is ('sprite name #r #spriteName)

Code:

spriteName
    ^ self objName

Thanks!!! But what I really need to know the most is where exactly to put the <sprite_ touching_> block. I think LS97 knows where, but if ANYONE can tell me it would be greatly appreciated.  smile

Offline

 

#314 2010-05-14 17:51:40

Joeman592
Scratcher
Registered: 2010-01-23
Posts: 100+

Re: Cool custom blocks in Scratch

pyrodon wrote:

Joeman592 wrote:

pyrodon wrote:

Hi LS97. I'm not sure how to use the <sprite _ touching sprite> block that you made. Could you please tell me where to put all the code? I tried in many places and I still get errors.

Also, does anyone know the codes for the following and where to put them?

If touching sprite_, bounce
flip
(report name of sprite)
clone
delete me

Thanks in advance!

delete me is ('delete me' #- #deleteMe)

Code:

deleteMe
    self delete

p.s. made code myself!

report sprite name is ('sprite name #r #spriteName)

Code:

spriteName
    ^ self objName

Thanks!!! But what I really need to know the most is where exactly to put the <sprite_ touching_> block. I think LS97 knows where, but if ANYONE can tell me it would be greatly appreciated.  smile

put it in sensing. Scratch-objects, scritpable sprite(or stage, put it in both)morph, sensing. Put the code in blah blah blah, then go to class and make the spec. do it again for the stage/sprite morph(if you did one or the other first) if you want it to be a bounce at te end, put it in motion.

Last edited by Joeman592 (2010-05-14 17:52:52)


http://i.imgur.com/HcAj1.png
http://i.imgur.com/gss7S.gifhttp://i.imgur.com/kbcKt.gifhttp://i.imgur.com/0LteM.gif

Offline

 

#315 2010-05-14 17:55:18

Joeman592
Scratcher
Registered: 2010-01-23
Posts: 100+

Re: Cool custom blocks in Scratch

comp500 wrote:

Can i have:

create sprite [] run code
         (code)
<end>

With the spec?
It creates a sprite named[] and runs the code on it.
Comp500:)

i think the creat sprite is good and then with code would be good too. I'll try to make em but im not very good with squeak so LS97 or nXIII will also have to do it. They are MUCH MUCH(times 9999999999999999999999) better than me.


http://i.imgur.com/HcAj1.png
http://i.imgur.com/gss7S.gifhttp://i.imgur.com/kbcKt.gifhttp://i.imgur.com/0LteM.gif

Offline

 

#316 2010-05-14 17:58:57

Catwalk923
Scratcher
Registered: 2010-01-30
Posts: 47

Re: Cool custom blocks in Scratch

LS97 wrote:

Catwalk923 wrote:

Um... I really WOULD like to know how to fix the get [date] block. I used your code, but I can't use the get [date] block to work! What do I do???

hmm... i tried it and figured it out. i programmed it to report 'Error!' if the string entered did not match any of the options. if there had been a real error, it would have reported blank. so try entering 'help' after the (get[ bit. no spaces or punctuation!

see if that helps

Hm... Wonder why that had to be done? Least it worked! Will I have to do that every time I start it up?


ılıll|̲̅̅●̲̅̅|̲̅̅=̲̅̅|̲̅̅●̲̅̅|llılı

Offline

 

#317 2010-05-14 18:09:30

BigBellStudio
Scratcher
Registered: 2010-03-13
Posts: 10

Re: Cool custom blocks in Scratch

How do you save the changes? I entered the first data but when I tried to switch to instances it said "Changes have not been saved. Is it OK to cancel those changes?" if you push no it stays in the same place. If you push yes it switches but deletes your changes. How do I save it?


Play my game Chain Reaction: http://scratch.mit.edu/projects/BigBellStudio/964288

Offline

 

#318 2010-05-14 18:14:21

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: Cool custom blocks in Scratch

LS97 wrote:

johnnydean1 wrote:

Could you make me a <sprite _ touching sprite_> block

I'll try and see what i can do. Check back in a few mins, i might have it up!
EDIT: i got the block. here's the code:

Code:

sprite: t1 touching: t2 
    | t3 |
    t3 _ t1 bounds intersect: t2 bounds.
    (t3 width > 0 and: [t3 height > 0])
        ifTrue: [^ true].
    ^ false

i'm so proud of myself  smile

But doesn't that operate on rectangles? It should operate on the costumes.


nXIII

Offline

 

#319 2010-05-14 18:36:40

pyrodon
Scratcher
Registered: 2010-03-27
Posts: 6

Re: Cool custom blocks in Scratch

Joeman592 wrote:

pyrodon wrote:

Joeman592 wrote:

delete me is ('delete me' #- #deleteMe)

Code:

deleteMe
    self delete

p.s. made code myself!

report sprite name is ('sprite name #r #spriteName)

Code:

spriteName
    ^ self objName

Thanks!!! But what I really need to know the most is where exactly to put the <sprite_ touching_> block. I think LS97 knows where, but if ANYONE can tell me it would be greatly appreciated.  smile

put it in sensing. Scratch-objects, scritpable sprite(or stage, put it in both)morph, sensing. Put the code in blah blah blah, then go to class and make the spec. do it again for the stage/sprite morph(if you did one or the other first) if you want it to be a bounce at te end, put it in motion.

I tried, but I get the error:

Code:

 Message not understood: Bounds
Symbol(Object)>>error:
[] in PasteUpMorph>>runStepMethods
[] in BlockContext>>ifError:
Symbol(Object)>>error:
Symbol(Object)>>doesNotUnderstand:
ScratchSpriteMorph>>sprite:touching:
ReporterBlockMorph(CommandBlockMorph)>>evaluateWithArgs:
ScratchProcess>>applyPrimitive
ScratchProcess>>evaluateCommandFor:
ScratchProcess>>evaluateFor:

Maybe I have the wrong codes or something. Anyone know a code that they are sure works?

Offline

 

#320 2010-05-14 22:04:14

Catwalk923
Scratcher
Registered: 2010-01-30
Posts: 47

Re: Cool custom blocks in Scratch

HELP!!! I can't find the code grabFromScreen!!! How do I add it? I tried the block, but it does not know what #grabFromSceen means! HELP!!!


ılıll|̲̅̅●̲̅̅|̲̅̅=̲̅̅|̲̅̅●̲̅̅|llılı

Offline

 

#321 2010-05-14 22:21:58

Joeman592
Scratcher
Registered: 2010-01-23
Posts: 100+

Re: Cool custom blocks in Scratch

pyrodon wrote:

Joeman592 wrote:

pyrodon wrote:


Thanks!!! But what I really need to know the most is where exactly to put the <sprite_ touching_> block. I think LS97 knows where, but if ANYONE can tell me it would be greatly appreciated.  smile

put it in sensing. Scratch-objects, scritpable sprite(or stage, put it in both)morph, sensing. Put the code in blah blah blah, then go to class and make the spec. do it again for the stage/sprite morph(if you did one or the other first) if you want it to be a bounce at te end, put it in motion.

I tried, but I get the error:

Code:

 Message not understood: Bounds
Symbol(Object)>>error:
[] in PasteUpMorph>>runStepMethods
[] in BlockContext>>ifError:
Symbol(Object)>>error:
Symbol(Object)>>doesNotUnderstand:
ScratchSpriteMorph>>sprite:touching:
ReporterBlockMorph(CommandBlockMorph)>>evaluateWithArgs:
ScratchProcess>>applyPrimitive
ScratchProcess>>evaluateCommandFor:
ScratchProcess>>evaluateFor:

Maybe I have the wrong codes or something. Anyone know a code that they are sure works?

well... i dont... anyway, i don't get what this code is. could you put the actual code without the error messages? then we can see if its wrong


http://i.imgur.com/HcAj1.png
http://i.imgur.com/gss7S.gifhttp://i.imgur.com/kbcKt.gifhttp://i.imgur.com/0LteM.gif

Offline

 

#322 2010-05-14 22:28:42

ScratchReallyROCKS
Scratcher
Registered: 2009-04-22
Posts: 1000+

Re: Cool custom blocks in Scratch

There's a much easier way to make the delete me block:

Code:

('delete me' #- #delete)

no instance needed

and the duplicate blocks:

Code:

for duplicating to the stage: ('duplicate sprite to stage' #- #duplicateNoAttach)
for duplicating to the mouse pointer: ('duplicate sprite to mouse pointer' #- #duplicate)

Last edited by ScratchReallyROCKS (2010-05-14 22:32:24)


http://imageshack.us/a/img694/3806/sigmad.png

Offline

 

#323 2010-05-14 22:29:07

Joeman592
Scratcher
Registered: 2010-01-23
Posts: 100+

Re: Cool custom blocks in Scratch

Catwalk923 wrote:

HELP!!! I can't find the code grabFromScreen!!! How do I add it? I tried the block, but it does not know what #grabFromSceen means! HELP!!!

are you using scratch 1.3 or 1.4 it might matter. also, try just copying and pasting if you didn't already do that


http://i.imgur.com/HcAj1.png
http://i.imgur.com/gss7S.gifhttp://i.imgur.com/kbcKt.gifhttp://i.imgur.com/0LteM.gif

Offline

 

#324 2010-05-14 23:18:42

Joeman592
Scratcher
Registered: 2010-01-23
Posts: 100+

Re: Cool custom blocks in Scratch

ScratchReallyROCKS wrote:

There's a much easier way to make the delete me block:

Code:

('delete me' #- #delete)

no instance needed

and the duplicate blocks:

Code:

for duplicating to the stage: ('duplicate sprite to stage' #- #duplicateNoAttach)
for duplicating to the mouse pointer: ('duplicate sprite to mouse pointer' #- #duplicate)

cool you found that out!


http://i.imgur.com/HcAj1.png
http://i.imgur.com/gss7S.gifhttp://i.imgur.com/kbcKt.gifhttp://i.imgur.com/0LteM.gif

Offline

 

#325 2010-05-14 23:22:53

Joeman592
Scratcher
Registered: 2010-01-23
Posts: 100+

Re: Cool custom blocks in Scratch

also an easier way to make sprite name would be ('sprite name' #r #objName)


http://i.imgur.com/HcAj1.png
http://i.imgur.com/gss7S.gifhttp://i.imgur.com/kbcKt.gifhttp://i.imgur.com/0LteM.gif

Offline

 

Board footer