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

#1 2007-08-15 15:03:31

AlveKatt
Scratcher
Registered: 2007-08-12
Posts: 100+

The timer

A Wait until "timer reset" would be handy.

Offline

 

#2 2007-08-15 15:44:29

beny
Scratcher
Registered: 2007-07-24
Posts: 100+

Re: The timer

your right


more people like the letter B than the letter A!
i'm going for 250 posts!

Offline

 

#3 2007-08-15 16:23:56

Mayhem
Scratcher
Registered: 2007-05-26
Posts: 1000+

Re: The timer

Would "wait until timer=0" not work for that?


Web-spinning Spider:  http://scratch.mit.edu/projects/Mayhem/18456
3D Dungeon Adventure:  http://scratch.mit.edu/projects/Mayhem/23570
Starfighter X: http://scratch.mit.edu/projects/Mayhem/21825
Wandering Knight: http://scratch.mit.edu/projects/Mayhem/28484

Offline

 

#4 2007-08-16 00:22:23

AlveKatt
Scratcher
Registered: 2007-08-12
Posts: 100+

Re: The timer

Mayhem wrote:

Would "wait until timer=0" not work for that?

I tried that. I noticed that the timer doesn't work with =, just < and >.

I tried using a really small decimal. But I noticed that it doesn't allways react to them.

Offline

 

#5 2007-08-16 08:14:17

mdusoe
Scratcher
Registered: 2007-06-14
Posts: 32

Re: The timer

I am not able to test this right now, but if you can't use timer = 0, then what about

wait until not(timer > 0)

Offline

 

#6 2007-08-16 08:56:59

Mayhem
Scratcher
Registered: 2007-05-26
Posts: 1000+

Re: The timer

I think the issue is probably that the timer is zero for such a short time, it is easy for the "wait until" script to miss it.

You could try

Wait until (Round (Timer) = 0)

As long as you are not resetting your timer more than 1 time per half second, that would do it, I think.


Web-spinning Spider:  http://scratch.mit.edu/projects/Mayhem/18456
3D Dungeon Adventure:  http://scratch.mit.edu/projects/Mayhem/23570
Starfighter X: http://scratch.mit.edu/projects/Mayhem/21825
Wandering Knight: http://scratch.mit.edu/projects/Mayhem/28484

Offline

 

#7 2007-08-16 11:33:31

AlveKatt
Scratcher
Registered: 2007-08-12
Posts: 100+

Re: The timer

Hmmm. Well, If you look at the newest version of the game that I am doing, (that you helped me get working), you will see that the timer very well might be reset in less than half a second.

Since pen colours don't show up over sprites, do you have any idea of how to implement painting with the line made of many sprites? I sat up yesterday working on until I was so tired that I couldn't understand my own scratch code...

Offline

 

#8 2007-08-16 20:35:51

AlveKatt
Scratcher
Registered: 2007-08-12
Posts: 100+

Re: The timer

Also, an option for angles "If angle is less than that then do this" would be handy.

I actually managed to implement this on my project but figuring it out almost did my head in. http://scratch.mit.edu/projects/AlveKatt/29697 (The line sprites chooses a longer costume if you do a straight line. But if you make sharp turn the Line sprite chooses a shorter costume. I tried having three different lengths at first, but it got too slow. The line just couldn't keep up.)

Offline

 

#9 2007-08-18 20:58:46

samir321
Scratcher
Registered: 2007-07-15
Posts: 6

Re: The timer

AlveKatt wrote:

Mayhem wrote:

Would "wait until timer=0" not work for that?

I tried that. I noticed that the timer doesn't work with =, just < and >.

I tried using a really small decimal. But I noticed that it doesn't allways react to them.

try

wait until timer<1

<wait until><(<timer>  <<> 1 )>

Offline

 

Board footer