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

#1 2010-04-04 11:48:57

rubiks_cube_guy238
Scratcher
Registered: 2009-07-02
Posts: 100+

How to make Virtual Blocks

A lot of people have been posting projects like 'Blocks I Want To See'. But, beleive it or not, an average of ~25% of these blocks can easily be done, by using other blocks. This forum topic is a list of blocks that a lot of people want, and how to do them using other blocks.

[restart] block: It is a little known fact, but this CAN be done. All you need to do is [broadcast [scratch-startclicked]], but this only works offline. You can take advantage of this not working to kame an online/offline detector, one of which I have in my stuff.

[previous costume] block: This can easily be done with [switch to costume ((costume #) - 1)].

[go forward (1) layers] block: Very simply done with [go back (-1) layers].

I'll make additions to this list on a whenever-I-feel-like-it basis.

Last edited by rubiks_cube_guy238 (2010-04-06 19:19:14)


The glass is never half full nor half empty; it is twice as large as it needs to be.

Offline

 

#2 2010-04-04 14:49:36

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

Re: How to make Virtual Blocks

I just realized that (inspired by the 'Scratch-StartClicked') you can use [broadcast 'Scratch-MouseClickEvent'] to fire a 'universal click' (everything was clicked at once)...  big_smile


nXIII

Offline

 

#3 2010-04-04 15:25:31

gershmer
Scratcher
Registered: 2009-02-12
Posts: 1000+

Re: How to make Virtual Blocks

rubiks_cube_guy238 wrote:

[restart] block: It is a little known fact, but this CAN be done. All you need to do is [broadcast [scratch-startclicked]], but this only works offline..

No it works online, too.
http://scratch.mit.edu/projects/gershmer/892952


Visit my site, Gershmer.net
Leave me a voicemail at my Google Voice number, [removed]

Offline

 

#4 2010-04-06 19:17:23

rubiks_cube_guy238
Scratcher
Registered: 2009-07-02
Posts: 100+

Re: How to make Virtual Blocks

gershmer wrote:

rubiks_cube_guy238 wrote:

[restart] block: It is a little known fact, but this CAN be done. All you need to do is [broadcast [scratch-startclicked]], but this only works offline..

No it works online, too.
http://scratch.mit.edu/projects/gershmer/892952

Yes, but that was in Squeak itself, not Scratch. Simply broadcasting scratch-startclicked will not work online.


The glass is never half full nor half empty; it is twice as large as it needs to be.

Offline

 

#5 2010-04-06 19:20:05

rubiks_cube_guy238
Scratcher
Registered: 2009-07-02
Posts: 100+

Re: How to make Virtual Blocks

nXIII wrote:

I just realized that (inspired by the 'Scratch-StartClicked') you can use [broadcast 'Scratch-MouseClickEvent'] to fire a 'universal click' (everything was clicked at once)...  big_smile

Wow... That's cool! I'll add that into the list.


The glass is never half full nor half empty; it is twice as large as it needs to be.

Offline

 

#6 2010-04-06 19:31:19

gershmer
Scratcher
Registered: 2009-02-12
Posts: 1000+

Re: How to make Virtual Blocks

rubiks_cube_guy238 wrote:

gershmer wrote:

rubiks_cube_guy238 wrote:


No it works online, too.
http://scratch.mit.edu/projects/gershmer/892952

Yes, but that was in Squeak itself, not Scratch. Simply broadcasting scratch-startclicked will not work online.

Uh... no. It just worked for me in Java. Take a look.


Visit my site, Gershmer.net
Leave me a voicemail at my Google Voice number, [removed]

Offline

 

#7 2010-04-11 20:38:57

pika100chu
Scratcher
Registered: 2009-07-26
Posts: 500+

Re: How to make Virtual Blocks

You CAN make a previous costume block by editing the source code, not sure about the other two, though. Way I know this: I have 1.  big_smile

Offline

 

#8 2010-04-12 14:40:19

markyparky56
Scratcher
Registered: 2008-03-20
Posts: 1000+

Re: How to make Virtual Blocks

pika100chu wrote:

You CAN make a previous costume block by editing the source code, not sure about the other two, though. Way I know this: I have 1.  big_smile

But why go to all that hassel when you can just do the
[blocks]
<switch to costume[ (( (costume) <-> 1 ))
[/blocks]

Last edited by markyparky56 (2010-04-12 14:40:52)


http://j.mp/jgVnTq
Check out my game engine development site: NewDawn I'm a Level 171 Scratcher.I am http://bit.ly/nkvLNT

Offline

 

Board footer