Pages: 1
Topic closed
i'm trying to think of a way to stop a script, wait for either 3 seconds to pass or for the sprite to be touching the 'player'... i can do this using variable/timer/broadcast but what bout keeping it in one script without using the timer or variables.
i dnt think thrs a way - maybe the next scratch shud include something like:
Wait [ ] seconds or until < >
i'll put this in suggestions aswell.
thx. dibbo.
Offline
You can easily do this with 2 scripts.
Create a variable called SecondsPast and set it to 0
Then have a script:
when Start received
set SecondsPast to 0
wait 3 seconds
set SecondsPast to 1
Then, have another script:
when Start received
wait until (SecondsPast = 1) or (Touching PlayerSprite)
...
etc.
Hope this helps.
Last edited by BoltBait (2009-05-08 10:30:36)
Offline
Just use
reset timer
wait until < key space pressed > or < timer>3 >
That should work.
If you already use the timer somewhere else in your program, use
set time to timer
wait until < key space pressed > or < timer > (time + 3) >
Offline
JSO wrote:
Just use
reset timer
wait until < key space pressed > or < timer>3 >That should work.
If you already use the timer somewhere else in your program, useset time to timer
wait until < key space pressed > or < timer > (time + 3) >
yeh thx for the help but now i see that u cnt do it without the new block, variables, the timer or broadcasting.
i've used variables in the game im making now, although the script wud be 5 times as short if i had that block
Offline
not the most accurate way but:
<repeat( 30
if touching script with if and all
<wait( 0.08 )secsc>
dont quite want it to be 0.1 as each block has a little built in timer
Last edited by yambanshee (2009-05-08 10:59:18)
Offline
Dibbo222 wrote:
JSO wrote:
Just use
reset timer
wait until < key space pressed > or < timer>3 >That should work.
If you already use the timer somewhere else in your program, useset time to timer
wait until < key space pressed > or < timer > (time + 3) >yeh thx for the help but now i see that u cnt do it without the new block, variables, the timer or broadcasting.
i've used variables in the game im making now, although the script wud be 5 times as short if i had that block![]()
What block are you talking about? As far as I'm aware, all of the blocks in the script have always been there.
Offline
I think he means the < >and< > block.
But it already exists, just look in the Numbers tab.
<< <and> >>[/blocks]
Offline
no, as said in the first post, this block:
Wait [ ] seconds or until < >
<wait( << 3 >> <or> until <touching[ player >> )secs>
something like that above ^^
Offline
mine will do the trick. using existing blocks its the easiest alternative i can think off
Offline
Dibbo222 wrote:
no, as said in the first post, this block:
Wait [ ] seconds or until < >
[blocks]
<wait( << 3 >> <or> until <touching[ player >> )secs>
[/blocks]
something like that above ^^
I think you're confusing [wait until < > ] and [wait ( ) secs]. JSO suggested using "wait until", which does exist. For clarification:
[blocks]
<reset timer>
<wait until><< <( <timer> <=> 4 )> <or> <touching[ sprite 1 >>
[/blocks]
That should work.
Last edited by coolstuff (2009-05-09 09:37:23)
Offline
coolstuff wrote:
Dibbo222 wrote:
no, as said in the first post, this block:
Wait [ ] seconds or until < >
[blocks]
<wait( << 3 >> <or> until <touching[ player >> )secs>
[/blocks]
something like that above ^^I think you're confusing [wait until < > ] and [wait ( ) secs]. JSO suggested using "wait until", which does exist. For clarification:
[blocks]
<reset timer>
<wait until><< <( <timer> <=> 4 )> <or> <touching[ sprite 1 >>
[/blocks]
That should work.
yes that shud work - but what if i had 10 sprites running the same script? the timer wud be all mucked up.
MAYBE a timer1, timer2, timer3 or a timer{ } (u choose the number of the timer u wish to use at this script. they're all seperate timers)
Offline
Dibbo222 wrote:
yes that shud work - but what if i had 10 sprites running the same script? the timer wud be all mucked up.
MAYBE a timer1, timer2, timer3 or a timer{ } (u choose the number of the timer u wish to use at this script. they're all seperate timers)
using some very basic maths i could make a variable thats the same as the timer. I use it all the time in flash, as there is no real wait x seconds command
Offline
Topic closed
Pages: 1