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

#1 2009-05-08 08:36:58

Dibbo222
Scratcher
Registered: 2007-11-03
Posts: 100+

New Block: "Wait ( ) seconds or until < >"

Wait (  ) seconds or until <   >

any other way to do this block WITHOUT using variable/timer/broadcasting?!?!?

thx. dibbo.


The biggest tower defense game on Scratch?
http://scratch.mit.edu/projects/Dibbo222/929092

Offline

 

#2 2009-05-08 09:47:30

technoguyx
Scratcher
Registered: 2008-10-18
Posts: 1000+

Re: New Block: "Wait ( ) seconds or until < >"

Dibbo222 wrote:

Wait (  ) seconds or until <   >

any other way to do this block WITHOUT using variable/timer/broadcasting?!?!?

thx. dibbo.

No, there isn't. Anyway, what's wrong with variables, timer, or broadcasting?


http://getgnulinux.org/links/en/linuxliberated_4_78x116.png

Offline

 

#3 2009-05-08 09:53:08

Dibbo222
Scratcher
Registered: 2007-11-03
Posts: 100+

Re: New Block: "Wait ( ) seconds or until < >"

timer: it cud get mixed up with other sprites that are 'resetting the timer' aswell.

broadcasting: not much wrong but it'd be better keeping it in one script so u dnt get confused when changing scripts...

variable: best option but a block for it wud be MUCH easier.


The biggest tower defense game on Scratch?
http://scratch.mit.edu/projects/Dibbo222/929092

Offline

 

#4 2009-05-08 09:58:38

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: New Block: "Wait ( ) seconds or until < >"

repeat 30{
wait.1 sec
if key pressed{
stop script}
}


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#5 2009-05-08 10:13:39

BWOG
Scratcher
Registered: 2008-09-19
Posts: 1000+

Re: New Block: "Wait ( ) seconds or until < >"

archmage wrote:

repeat 30{
wait.1 sec
if key pressed{
stop script}
}

But if you press the key within the .990 seconds in between...

Offline

 

#6 2009-05-09 19:15:05

bhz
Scratcher
Registered: 2008-07-06
Posts: 100+

Re: New Block: "Wait ( ) seconds or until < >"

wait ( A ) secs or until < B >

1. Make Variable [ C ]
Scripts:
http://img391.imageshack.us/img391/2453/byob.gif
*** Thanks to BYOB for the Boolean graphic

Last edited by bhz (2009-05-09 19:15:33)

Offline

 

#7 2009-05-09 22:40:07

Dibbo222
Scratcher
Registered: 2007-11-03
Posts: 100+

Re: New Block: "Wait ( ) seconds or until < >"

archmage wrote:

repeat 30{
wait.1 sec
if key pressed{
stop script}
}

yes but i want to continue the script after either 3 seconds or touching something. hmmm how about:

<repeat( 30 )>
  <if> touching player )>
      <wait( 0 )secs>
  <else>
      <wait( 0.1 )secs>
  <end>
<end>

the above wud wait 3 seconds but as soon as the sprite is touching player, it will wait 0 seconds until the repeat loop is over.. only problem is that if the sprite only touches the player for a very small ammount of time - which is unlikely in my game anyway


The biggest tower defense game on Scratch?
http://scratch.mit.edu/projects/Dibbo222/929092

Offline

 

#8 2009-05-10 11:47:08

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: New Block: "Wait ( ) seconds or until < >"

Honestly, you could just use a list for all the timers. Or just subtract the time it began from when it stopped. For example:

[wait until < < ( (timerStart) - (timer) ) = 3 > or < key [space] pressed > ]

Offline

 

#9 2009-05-21 20:44:29

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

Re: New Block: "Wait ( ) seconds or until < >"

Dibbo222 wrote:

Wait (  ) seconds or until <   >

any other way to do this block WITHOUT using variable/timer/broadcasting?!?!?

thx. dibbo.

I agree. It would be nice to have a block like <key[ this ]pressed?> that said
<wait(  )secs>  I think it's a good idea.

Last edited by Oneandonly (2009-05-21 20:45:24)

Offline

 

#10 2009-06-02 08:43:25

Ritz1
Scratcher
Registered: 2009-06-02
Posts: 7

Re: New Block: "Wait ( ) seconds or until < >"

Try this for your project.<{ b<change{ b }by( <change{ c<change{ a }by(  }by( <timer> }><repeat( <when green flag clicked>

Offline

 

#11 2009-06-02 08:46:07

Ritz1
Scratcher
Registered: 2009-06-02
Posts: 7

Re: New Block: "Wait ( ) seconds or until < >"

try this.<when green flag clicked><repeat( <{ b<change{ b }by( <timer> }><change{ a }by( <change{ c }by( <timer><end>

Offline

 

#12 2009-06-02 13:47:02

Stickman704
Scratcher
Registered: 2009-01-31
Posts: 1000+

Re: New Block: "Wait ( ) seconds or until < >"

wait ( ) seconds? we've got that already haven't we?

Last edited by Stickman704 (2009-06-02 13:47:21)


Dun dun dun dun dun dun.... dun dun dun dun dun dun...  tongue

Offline

 

#13 2009-06-02 14:57:05

technoguyx
Scratcher
Registered: 2008-10-18
Posts: 1000+

Re: New Block: "Wait ( ) seconds or until < >"

Stickman704 wrote:

wait ( ) seconds? we've got that already haven't we?

"Wait (  ) seconds or until <   >"  tongue


http://getgnulinux.org/links/en/linuxliberated_4_78x116.png

Offline

 

#14 2009-06-02 17:03:59

basmin
Scratcher
Registered: 2009-06-02
Posts: 7

Re: New Block: "Wait ( ) seconds or until < >"

nice project

Offline

 

#15 2009-06-03 08:19:56

Ritz1
Scratcher
Registered: 2009-06-02
Posts: 7

Re: New Block: "Wait ( ) seconds or until < >"

How bout this?!
<when green flag clicked>
<repeat( <{ b }>
<change{ b }by( <timer>
<change{ a }by( <timer>
<change{ c }by( <timer>
<end>

Offline

 

Board footer