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

#1 2011-08-29 05:49:54

ProgrammingAddict
New Scratcher
Registered: 2011-08-23
Posts: 22

Idea for new block

Don't know about any of you, but I would be able to do a lot more if there was a block like this:
if    for    secs

Because without it you couldn't make a game where if the right arrow key is held down for two seconds then something happens, but if it's held down for less than that nothing happens.

Offline

 

#2 2011-08-29 05:51:09

Sonickyle
Scratcher
Registered: 2010-10-16
Posts: 100

Re: Idea for new block

You Could Use Varibles For This, But I Support.  big_smile


http://i1270.photobucket.com/albums/jj616/Sonickyle27/BannerV1.png
My Online Status on Scratch: http://blocks.scratchr.org/API.php?user=Sonickyle&action=onlineStatus

Offline

 

#3 2011-08-29 06:16:32

ProgrammingAddict
New Scratcher
Registered: 2011-08-23
Posts: 22

Re: Idea for new block

Sonickyle wrote:

You Could Use Varibles For This, But I Support.  big_smile

How?

Offline

 

#4 2011-08-29 09:10:13

DigiTechs
Scratcher
Registered: 2011-04-30
Posts: 500+

Re: Idea for new block

ProgrammingAddict wrote:

Sonickyle wrote:

You Could Use Varibles For This, But I Support.  big_smile

How?

if <[Right Arrow v] pressed>
wait 2 secs
if <[Right Arrow v] pressed> --(This checks if its still pressed after two secconds)
code here -- script to do what u wanna do


I'm back.
Maybe.

Offline

 

#5 2011-08-29 13:41:47

ProgrammingAddict
New Scratcher
Registered: 2011-08-23
Posts: 22

Re: Idea for new block

DigiTechs wrote:

ProgrammingAddict wrote:

Sonickyle wrote:

You Could Use Varibles For This, But I Support.  big_smile

How?

if <[Right Arrow v] pressed>
wait 2 secs
if <[Right Arrow v] pressed> --(This checks if its still pressed after two secconds)
code here -- script to do what u wanna do

Yeah, but you'd need a forever block around it, and that would cause it to wait 2 secs, do whatever you want for 2 secs, and then wait for 2 secs again, and then whatever you want again, and then... well I think you get the message.

Although maybe something like this?

<when green flag clicked>
<forever>
<if><<  <not> <key[ right arrow ]pressed?> >>
<wait until><key[ right arrow ]pressed?>
<wait( 2 )secsc>
<forever if><key[ right arrow ]pressed?>
whatever you want
<end>

Would still be easier if there was the block I suggested, as I doubt absolute beginners would figure that out!

Offline

 

#6 2011-08-29 15:04:34

hmnwilson
Scratcher
Registered: 2007-07-04
Posts: 1000+

Re: Idea for new block

This way works too, and is pretty easy:
http://www.freeimagehosting.net/newuploads/bf67d.gif

Last edited by hmnwilson (2011-08-29 15:05:51)


I'm taking a break from Scratch until 2.0 comes out. Any messages sent between then and now probably won't be read - sorry.
(Oct. 20, 2011)

Offline

 

#7 2011-08-29 15:20:47

flamekyle
Scratcher
Registered: 2011-03-18
Posts: 1000+

Re: Idea for new block

Sonickyle wrote:

You Could Use Varibles For This, But I Support.  big_smile

But what if that block is not used, what would be the point?


http://prodegebanners.sitegrip.com/images/swagbucks-173x63Alt5.jpg

Offline

 

#8 2011-08-31 07:32:24

ProgrammingAddict
New Scratcher
Registered: 2011-08-23
Posts: 22

Re: Idea for new block

hmnwilson:
Yes, but wouldn't that just constantly reset the timer. I mean the bit where it says
<forever>
<if><key[ space ]pressed?>
<reset timer>
<end>
<end>

Offline

 

#9 2011-08-31 13:28:23

videogame9
Scratcher
Registered: 2008-05-12
Posts: 1000+

Re: Idea for new block

ProgrammingAddict wrote:

hmnwilson:
Yes, but wouldn't that just constantly reset the timer. I mean the bit where it says
<forever>
<if><key[ space ]pressed?>
<reset timer>
<end>
<end>

No, it wouldn't.


http://img641.imageshack.us/img641/4118/newvg9logo.png
QUOTE OF THE RIGHT NOW: why are we arguing about dead babies? -videogame9

Offline

 

#10 2011-08-31 16:25:15

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

Re: Idea for new block

http://www.ragemaker.net/images/Laughing/34.png


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

Offline

 

#11 2011-08-31 17:46:03

hmnwilson
Scratcher
Registered: 2007-07-04
Posts: 1000+

Re: Idea for new block

ProgrammingAddict wrote:

hmnwilson:
Yes, but wouldn't that just constantly reset the timer. I mean the bit where it says
<forever>
<if><key[ space ]pressed?>
<reset timer>
<end>
<end>[/blocks]

That script right there would, yes, but not if you add the wait/if blocks. Granted, it does mean you can't use the timer for anything else, but you can make one with a variable if needed.


I'm taking a break from Scratch until 2.0 comes out. Any messages sent between then and now probably won't be read - sorry.
(Oct. 20, 2011)

Offline

 

Board footer