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

#1 2011-11-13 21:27:18

Shigufa
New Scratcher
Registered: 2011-11-13
Posts: 2

Time Problems :\

My game is like this
If you hit the button 100 time is 60 seconds, then YAY
if you don't, Try again

how do i get it to count how many times it been hit at 60 seconds and then say YAY or NAY?

Offline

 

#2 2011-11-13 23:46:56

Jonathanpb
Scratcher
Registered: 2008-07-25
Posts: 1000+

Re: Time Problems :\

Would this work?

[when I receive [script])
[set [count] to (0)]
[reset timer]
[repeat (60)]
[][wait until <key [space] pressed?>]
[][change [count] by (1)]
[][wait until <not <key [space] pressed?> >]
[end repeat]
[if <(timer) < (60)>]
[][say (join [You won! You scored: ] (count)]
[else]
[][say (join [You lost! You scored: ] (count) for (2) secs]]
[][broadcast [script]]
[end if, else]

Last edited by Jonathanpb (2011-11-13 23:53:59)


"Human beings... must have action; and they will make it if they cannot find it.
-Charlotte Brontë

Offline

 

#3 2011-11-14 04:48:51

anuw
Scratcher
Registered: 2009-04-09
Posts: 50

Re: Time Problems :\

When /= clicked
set [count variable] to 0
-------------------------------------------------------------
repeat until <[count variable] > 59| if <touching mouse?> and <mouse down?>
change [click variable] by 1
wait until| Not <mouse down?>
--------------------------------------
if <[click variable] > 99>
play sound [yay]
-------------------
else
-----
play sound [nay]
--------------------


Hoped it helped!  wink

~Anuw


http://lolwut.com/layout/lolwut.jpg Lolwut?

Offline

 

Board footer