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

#1 2013-04-09 16:09:14

jn3579
New Scratcher
Registered: 2012-02-27
Posts: 20

NEED HELP WITH VARIABLES. PLEASE HELP ITS DUE ON APRIL 30th

I am useing the variables as a timer instead of the timer function because i need it to start at a number instead of counting up. is there a way to get a broadcast send out when the variable reaches 0 for a game over function. PLEEZ HELP IT'S FOR A SCHOOL PROJECT DUE APRIL 30th.

Offline

 

#2 2013-04-09 16:13:16

jn3579
New Scratcher
Registered: 2012-02-27
Posts: 20

Re: NEED HELP WITH VARIABLES. PLEASE HELP ITS DUE ON APRIL 30th

srry i mean may 30th but still thats not a lot of time to program my school project

Offline

 

#3 2013-04-09 16:14:50

dr3w8
Scratcher
Registered: 2011-07-29
Posts: 81

Re: NEED HELP WITH VARIABLES. PLEASE HELP ITS DUE ON APRIL 30th

Is this what you were trying to do?

when gf clicked
set [time v] to (120)//or however many seconds you want it to count down from
repeat until <(time) = [0]>
 wait (1) secs
 change [time v] by (-1)
end
broadcast [game over v]

Last edited by dr3w8 (2013-04-09 16:15:58)


http://i46.tinypic.com/1zfr32r.gif
http://i37.tinypic.com/2qixx6c.png

Offline

 

#4 2013-04-09 16:22:32

jn3579
New Scratcher
Registered: 2012-02-27
Posts: 20

Re: NEED HELP WITH VARIABLES. PLEASE HELP ITS DUE ON APRIL 30th

thanks for your help
got it working

Offline

 

#5 2013-04-09 16:33:51

jn3579
New Scratcher
Registered: 2012-02-27
Posts: 20

Re: NEED HELP WITH VARIABLES. PLEASE HELP ITS DUE ON APRIL 30th

wait i worded it wrong i want it to broadcast game over when it hits 0 and below

Offline

 

#6 2013-04-09 16:39:01

jn3579
New Scratcher
Registered: 2012-02-27
Posts: 20

Re: NEED HELP WITH VARIABLES. PLEASE HELP ITS DUE ON APRIL 30th

nvm i was a thinking like a derp for a second there
tongue

Offline

 

#7 2013-04-09 16:59:24

shadowmouse
New Scratcher
Registered: 2013-02-03
Posts: 100+

Re: NEED HELP WITH VARIABLES. PLEASE HELP ITS DUE ON APRIL 30th

Why don't you use the actual timer (because it's more accurate) and set the variable time (which is shown) to whatever time it should start at - the value of the timer, broadcast game over when timer reaches the desired time and make sure to start with the reset timer block.  smile

Offline

 

Board footer