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

#1 2009-08-31 13:48:07

TimeFreeze
Scratcher
Registered: 2008-08-11
Posts: 500+

New block: << > for ( ) secs>

Um... I thought of this new block, it would be pretty useful. There is a way to get around it, but that gets really annoying. The block is a boolean block. This is what it would look like.

http://img215.imageshack.us/img215/8836/forsecs.gif

Basically, the boolean becomes true once the action inside has happened for a certain amount of time.

There is a way to get around this, but it gets annoying because you have to create another variable just for it. If I were to convert it into Scratch text kinda thing where you wanted an action to happen for 30 seconds:

Code:

>whenGreenFlagClicked<
[set (Var:"seconds") to (0)]
^repeatUntil <<(Var:"seconds")=(30)> and <action here>>^
[change (Var:"seconds") by (1)]
[wait (1) secs]
^end loop^
[whatever you want to happen after the time is over]

But with this block it would just be:

Code:

>whenGreenFlagClicked<
^if <<action> for ( ) secs>^
[whatever you want to happen after the time is over]
^end loop^

This would be useful for recreating games such as achievement unlocked, where the achievement, "Get off your seats" means you have to press the up arrow key for 15 seconds straight. It can also be useful for other things that I can't name right now, but I'm sure the scratch community will think of something!

Credit for the text version of blocks given to illusionist for the topic, Scratch Text

Share your thoughts!

Last edited by TimeFreeze (2009-08-31 13:52:50)


There are 10 types of people in this world: Those who understand binary, and those who don't. --[insert unrelated transition]-- GRANDILOQUENCE FTW!

Offline

 

#2 2009-08-31 18:28:24

TimeFreeze
Scratcher
Registered: 2008-08-11
Posts: 500+

Re: New block: << > for ( ) secs>

um... bump?


There are 10 types of people in this world: Those who understand binary, and those who don't. --[insert unrelated transition]-- GRANDILOQUENCE FTW!

Offline

 

#3 2009-08-31 18:37:03

The-Whiz
Scratcher
Registered: 2007-07-09
Posts: 1000+

Re: New block: << > for ( ) secs>

Ah... I understand now after the 'achievement unlocked' reference.

Offline

 

#4 2009-08-31 19:58:35

illusionist
Retired Community Moderator
Registered: 2008-07-02
Posts: 1000+

Re: New block: << > for ( ) secs>

TimeFreeze wrote:

Um... I thought of this new block, it would be pretty useful. There is a way to get around it, but that gets really annoying. The block is a boolean block. This is what it would look like.

http://img215.imageshack.us/img215/8836/forsecs.gif

Basically, the boolean becomes true once the action inside has happened for a certain amount of time.

There is a way to get around this, but it gets annoying because you have to create another variable just for it. If I were to convert it into Scratch text kinda thing where you wanted an action to happen for 30 seconds:

Code:

>whenGreenFlagClicked<
[set (Var:"seconds") to (0)]
^repeatUntil <<(Var:"seconds")=(30)> and <action here>>^
[change (Var:"seconds") by (1)]
[wait (1) secs]
^end loop^
[whatever you want to happen after the time is over]

But with this block it would just be:

Code:

>whenGreenFlagClicked<
^if <<action> for ( ) secs>^
[whatever you want to happen after the time is over]
^end loop^

This would be useful for recreating games such as achievement unlocked, where the achievement, "Get off your seats" means you have to press the up arrow key for 15 seconds straight. It can also be useful for other things that I can't name right now, but I'm sure the scratch community will think of something!

Credit for the text version of blocks given to illusionist for the topic, Scratch Text

Share your thoughts!

Thanks for using my code! I didn't think it would be taken so seriously...


http://i.imgur.com/8LX1NrV.png

Offline

 

#5 2009-08-31 20:15:59

TimeFreeze
Scratcher
Registered: 2008-08-11
Posts: 500+

Re: New block: << > for ( ) secs>

It's actually a really good way of communicating on the forums. I don't like using the blocks given mostly because they don't look too professional.


There are 10 types of people in this world: Those who understand binary, and those who don't. --[insert unrelated transition]-- GRANDILOQUENCE FTW!

Offline

 

#6 2009-09-01 09:57:00

TimeFreeze
Scratcher
Registered: 2008-08-11
Posts: 500+

Re: New block: << > for ( ) secs>

um... I seriously need people's thoughts on this new block. Come on people!


There are 10 types of people in this world: Those who understand binary, and those who don't. --[insert unrelated transition]-- GRANDILOQUENCE FTW!

Offline

 

#7 2009-09-01 14:14:17

treeko90097
Scratcher
Registered: 2008-03-03
Posts: 36

Re: New block: << > for ( ) secs>

I think this would be a good idea! I have to set up "achievements" with variables all the time... and it's kinda annoying  tongue


http://i196.photobucket.com/albums/aa242/treeko90097/squirtlealakazam.gifhttp://i196.photobucket.com/albums/aa242/treeko90097/slowpokeponyta.gifhttp://i196.photobucket.com/albums/aa242/treeko90097/slowkingwobbufett.gif
my best pokemorphs

Offline

 

#8 2009-09-01 18:47:39

keikij
Scratcher
Registered: 2009-02-22
Posts: 1000+

Re: New block: << > for ( ) secs>

Good idea, so if you hold down a button or something happens for a certain amount of time, only do it if held down that long.


Back from the Dead (And Stuff)

Offline

 

#9 2009-09-02 03:03:13

Chrischb
Scratcher
Registered: 2008-07-24
Posts: 1000+

Re: New block: << > for ( ) secs>

Yeah, every time I get around it it's like having my neck Karate-chopped.  tongue


I fall: It's a tragedy. You fall: It's comedy.
Hmph enjoy your fall - I get a lovely spring... without pans of new leaves.

Offline

 

Board footer