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

#976 2010-08-29 09:44:09

kinker
Scratcher
Registered: 2010-08-01
Posts: 100+

Re: Cool custom blocks in Scratch

The hide list block
_____________________________________________________
block spec:

Code:

('hide list %L' #- #hideList: 'list')

no code
And there u have it!


Put in the weirdness: http://i54.tinypic.com/zl6fph.pnghttp://img821.imageshack.us/i/gobanim2.gif/kinker style! [url]http://internetometer.com/image/16724.png[/url]♬♫ 92% of teens have moved on to rap. If you are part of the 8% who still listen to real music, copy and paste this into your signature. ♫♪

Offline

 

#977 2010-08-29 10:33:45

zorket
Scratcher
Registered: 2010-05-25
Posts: 500+

Re: Cool custom blocks in Scratch

kinker wrote:

The hide list block
_____________________________________________________
block spec:

Code:

('hide list %L' #- #hideList: 'list')

no code
And there u have it!

That didn't work for me.


Marzipan11 must learn to not spoil

Offline

 

#978 2010-08-29 12:08:32

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

Re: Cool custom blocks in Scratch

zorket wrote:

kinker wrote:

The hide list block
_____________________________________________________
block spec:

Code:

('hide list %L' #- #hideList: 'list')

no code
And there u have it!

That didn't work for me.

well in fact it's not true.

Offline

 

#979 2010-08-30 06:18:03

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

Re: Cool custom blocks in Scratch

bbbeb wrote:

It takes a lot to make one.
Look at 2 things:
the hats
and the execution engine.

Actually, most of the time you don't need to bother with the execution engine. The script starting is done in the hat block, it just creates an instance of ScratchProcess - the main class in the Execution Engine - which then works by itself. You just need to code the hat block, and that can be done most of the time by tweaking existing hat blocks.

BTW - How do you access all existing instances of an object? If it includes the keyword allInstances remind me to kick myself. And how can I make the scratchProc and proc instance variables of a hat block morph dictionaries? Never mind why, I'll post if my idea works.

Last edited by TheSuccessor (2010-08-30 07:06:03)


/* No comment */

Offline

 

#980 2010-08-30 12:22:00

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

Re: Cool custom blocks in Scratch

delete your bumps please.
and what do you want it for? i need to know that to help (if i'm able too  tongue  )

Last edited by LS97 (2010-08-30 12:22:53)

Offline

 

#981 2010-08-30 12:47:42

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

Re: Cool custom blocks in Scratch

I was making pause/play blocks, and to make them work for every currently running script I need to access each existing instance of ScratchProcess.

EDIT: I've just had a thought. Maybe I could create a class variable in ScratchProcess called IsPaused and make the execution engine check that before it executes the next block.

Last edited by TheSuccessor (2010-08-30 12:47:55)


/* No comment */

Offline

 

#982 2010-08-30 13:00:35

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: Cool custom blocks in Scratch

^ or make it a global!


You can now reach me on Twitter @johnnydean1_

Offline

 

#983 2010-08-30 13:53:51

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

Re: Cool custom blocks in Scratch

^^ not really... ^^^^that would be enough

Offline

 

#984 2010-08-30 14:19:58

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: Cool custom blocks in Scratch

^^^^^ Global would work!


You can now reach me on Twitter @johnnydean1_

Offline

 

#985 2010-08-30 14:31:46

zorket
Scratcher
Registered: 2010-05-25
Posts: 500+

Re: Cool custom blocks in Scratch

pwiter wrote:

I got a new block
http://img831.imageshack.us/img831/1435/capturesc.jpg
Instance ops:

Code:

| dialogBox |
    dialogBox _ DialogBoxMorph new.
    dialogBox title: t1.
    dialogBox withButtonsForYes: false no: false okay: true cancel: false.
    dialogBox message: t2.
    dialogBox getUserResponse.

Blockspecs

Code:

('show dialog titled %s with contents %s' #- #showDialogTitle:Contents: 'info' 'hello')

Copyright pwitter 2010

What does it do?


Marzipan11 must learn to not spoil

Offline

 

#986 2010-08-30 14:49:59

pwiter
Scratcher
Registered: 2010-06-02
Posts: 100+

Re: Cool custom blocks in Scratch

zorket wrote:

pwiter wrote:

I got a new block
http://img831.imageshack.us/img831/1435/capturesc.jpg
Instance ops:

Code:

| dialogBox |
    dialogBox _ DialogBoxMorph new.
    dialogBox title: t1.
    dialogBox withButtonsForYes: false no: false okay: true cancel: false.
    dialogBox message: t2.
    dialogBox getUserResponse.

Blockspecs

Code:

('show dialog titled %s with contents %s' #- #showDialogTitle:Contents: 'info' 'hello')

Copyright pwitter 2010

What does it do?

It opens up a dialog box titled whatever you want to say same for contents


http://i.imgur.com/YBeXc.png

Offline

 

#987 2010-08-30 18:51:01

Marioblender
Scratcher
Registered: 2010-04-04
Posts: 31

Re: Cool custom blocks in Scratch

Is there a block spec and method/code for the following blocks?

<undo pen> & <redo pen>

Offline

 

#988 2010-08-30 19:12:48

bbbeb
Scratcher
Registered: 2009-06-11
Posts: 1000+

Re: Cool custom blocks in Scratch

Not At the Moment I Think.
(I Think That Is Impossible!!) 0.o


Back in my day.... there were no laws that censored the internet... now, there are.... nah.

Offline

 

#989 2010-08-30 19:20:19

bbbeb
Scratcher
Registered: 2009-06-11
Posts: 1000+

Re: Cool custom blocks in Scratch

pwiter wrote:

zorket wrote:

pwiter wrote:

I got a new block
http://img831.imageshack.us/img831/1435/capturesc.jpg
Instance ops:

Code:

| dialogBox |
    dialogBox _ DialogBoxMorph new.
    dialogBox title: t1.
    dialogBox withButtonsForYes: false no: false okay: true cancel: false.
    dialogBox message: t2.
    dialogBox getUserResponse.

Blockspecs

Code:

('show dialog titled %s with contents %s' #- #showDialogTitle:Contents: 'info' 'hello')

Copyright pwitter 2010

What does it do?

It opens up a dialog box titled whatever you want to say same for contents

Use this code instead.
dialog inform:t1 with title: t2
     DialogBoxMorph inform: t1 withTitle:t2


Back in my day.... there were no laws that censored the internet... now, there are.... nah.

Offline

 

#990 2010-08-30 19:22:02

bbbeb
Scratcher
Registered: 2009-06-11
Posts: 1000+

Re: Cool custom blocks in Scratch

LS97 wrote:

TheSuccessor wrote:

Can anybody explain the Execution Engine? It just seems to push and pop stack frames. Is pushing and popping the same thing JavaScript does to arrays?

that would be something nice ² explain. i never get it either.

Study the Source code carefully....

Ive been doing that for a couple of days now!!


Back in my day.... there were no laws that censored the internet... now, there are.... nah.

Offline

 

#991 2010-08-31 11:30:53

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

Re: Cool custom blocks in Scratch

Marioblender wrote:

Is there a block spec and method/code for the following blocks?

<undo pen> & <redo pen>

not at the moment, i might have the patience to make it. but it sure will take a lot.

bbeb wrote:

Not At the Moment I Think.
(I Think That Is Impossible!!) 0.o

nothing is impossible to code. even if you had to code scratch from scratch. but it's still not impossible.

Offline

 

#992 2010-08-31 11:34:57

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: Cool custom blocks in Scratch

^^ Ha ha from Scratch!!!


You can now reach me on Twitter @johnnydean1_

Offline

 

#993 2010-08-31 11:35:58

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

Re: Cool custom blocks in Scratch

there was no pun intended there. laugh if you please  big_smile

Offline

 

#994 2010-08-31 11:54:32

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: Cool custom blocks in Scratch

L0l


You can now reach me on Twitter @johnnydean1_

Offline

 

#995 2010-08-31 15:25:34

Sperry
Scratcher
Registered: 2010-03-09
Posts: 500+

Re: Cool custom blocks in Scratch

There is absolutely no point in creating a pause block. Why? Because how will it know when to resume if nothing is running? It can't. So you don't need the play either. If you want to make a pause, make it the BYOB3 way, like next to the green flag and stop sign.


http://img709.imageshack.us/img709/3252/gobanim2.gifhttp://ls.gd/bo

Offline

 

#996 2010-08-31 15:43:04

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

Re: Cool custom blocks in Scratch

Sperry wrote:

There is absolutely no point in creating a pause block. Why? Because how will it know when to resume if nothing is running? It can't. So you don't need the play either. If you want to make a pause, make it the BYOB3 way, like next to the green flag and stop sign.

It will resume when another script e.g. when sprite clicked or when key pressed is triggered later on. Also, you could have pause all scripts for sprite whatever and a similar play block.


/* No comment */

Offline

 

#997 2010-08-31 15:44:56

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: Cool custom blocks in Scratch

or have
pause all other scripts.


You can now reach me on Twitter @johnnydean1_

Offline

 

#998 2010-09-01 07:26:26

Billybob-Mario
Scratcher
Registered: 2008-01-05
Posts: 500+

Re: Cool custom blocks in Scratch

How would you make a

<Sprite [ ] exsists?> (because of intensive cloning and deleting)

and a

[add ( ;; ) to costumes] (the weird thing is a costume block.)

Thank you.

Offline

 

#999 2010-09-01 07:46:54

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

Re: Cool custom blocks in Scratch

Code:

spriteExists: t1
World submorphsDo:
   [:t2 | t2 isKindOf: ScratchSpriteMorph ifTrue: [t2 objName = t1 ifTrue: [^ true]]].
   ^ false

I think this would work but as I haven't tried it I don't know.

Last edited by TheSuccessor (2010-09-01 07:47:42)


/* No comment */

Offline

 

#1000 2010-09-01 10:57:03

Billybob-Mario
Scratcher
Registered: 2008-01-05
Posts: 500+

Re: Cool custom blocks in Scratch

TheSuccessor wrote:

Code:

spriteExists: t1
World submorphsDo:
   [:t2 | t2 isKindOf: ScratchSpriteMorph ifTrue: [t2 objName = t1 ifTrue: [^ true]]].
   ^ false

I think this would work but as I haven't tried it I don't know.

Thank you. I'll test the code.

Offline

 

Board footer