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

#1 2010-06-14 14:19:26

fcbleos
New Scratcher
Registered: 2010-06-14
Posts: 5

Reset Timer @each new Level

Heya Guys,

i nearly finished my first programm with Scratch but now i have a lil problem with the timer - function.

I made a game called "parking lot", maybe you'll know already what the game is about. You have to guide a car through an parking-place filled with obstacles and you have to park the car in a red line, then you finished the lvl.

Everything works finde without the Timer function, but when i add the timer function the time runs down from x seconds(atm 10 Sec) and after the 10 sec it changes to a new background which says "you lost".  But if i competed lvl 1 the programm should "reset" the timer to 10 sec, but it doesnt. It just starts a second timer with 10 sec running down, but the first one still exist, although i made only 1 variable called "Timer" . If i try the raise the time by 10, it doesnt work either. Any ideas how to reset the timer each lvl?

I would be very pleased if theres so who could help me.

Thanks!

Offline

 

#2 2010-06-14 14:28:15

Wolfie1996
Retired Community Moderator
Registered: 2009-07-08
Posts: 1000+

Re: Reset Timer @each new Level

Hmm... could you upload ("share") the project? I'll take a look at the scripts, and I'll try to tell you how to make it do what you want  smile


"...Jargon - the practice of never calling a spade a spade, when you might instead call it a manual earth-restructing implement..." - Bill Bryson, Mother Tongue

Offline

 

#3 2010-06-14 14:38:36

fcbleos
New Scratcher
Registered: 2010-06-14
Posts: 5

Re: Reset Timer @each new Level

Wolfie1996 wrote:

Hmm... could you upload ("share") the project? I'll take a look at the scripts, and I'll try to tell you how to make it do what you want  smile

http://scratch.mit.edu/projects/fcbleos/1124174

Here you are and thanks for your efforts.

Offline

 

#4 2010-06-14 14:39:07

soupoftomato
Scratcher
Registered: 2009-07-18
Posts: 1000+

Re: Reset Timer @each new Level

You could make a variable instead of using the blue timer.

You set that variable to 10, and then let it run down during the level. If you run out of time, it says you lose, but if you hit sometime of trigger for winning (touch a color, etc) you use the block "set timer to 10".


I'm glad to think that the community will always be kind and helpful, the language will always be a fun and easy way to be introduced into programming, the motto will always be: Imagine, Program, Share - Nomolos

Offline

 

#5 2010-06-14 14:42:36

Wolfie1996
Retired Community Moderator
Registered: 2009-07-08
Posts: 1000+

Re: Reset Timer @each new Level

http://scratch.mit.edu/projects/fcbleos/1124174

Here you are and thanks for your efforts.

I saw it - I left a comment over there for you. I think my solution should work  smile


soupoftomato wrote:

You could make a variable instead of using the blue timer.

You set that variable to 10, and then let it run down during the level. If you run out of time, it says you lose, but if you hit sometime of trigger for winning (touch a color, etc) you use the block "set timer to 10".

fcbleos is already using a variable, as opposed to the blue timer - I checked  smile


"...Jargon - the practice of never calling a spade a spade, when you might instead call it a manual earth-restructing implement..." - Bill Bryson, Mother Tongue

Offline

 

#6 2010-06-14 14:58:11

fcbleos
New Scratcher
Registered: 2010-06-14
Posts: 5

Re: Reset Timer @each new Level

Wolfie1996 wrote:

http://scratch.mit.edu/projects/fcbleos/1124174

Here you are and thanks for your efforts.

I saw it - I left a comment over there for you. I think my solution should work  smile


soupoftomato wrote:

You could make a variable instead of using the blue timer.

You set that variable to 10, and then let it run down during the level. If you run out of time, it says you lose, but if you hit sometime of trigger for winning (touch a color, etc) you use the block "set timer to 10".

fcbleos is already using a variable, as opposed to the blue timer - I checked  smile

Thanks for the idea, but i already tried this solution and unfortunately it did not work either. I have no idea what im doing wrong^^

Offline

 

#7 2010-06-14 15:18:27

Wolfie1996
Retired Community Moderator
Registered: 2009-07-08
Posts: 1000+

Re: Reset Timer @each new Level

I have another idea - I'll upload a project with it on in a while (I have to go for a few minutes) I'll give you the link when I'm done  smile


"...Jargon - the practice of never calling a spade a spade, when you might instead call it a manual earth-restructing implement..." - Bill Bryson, Mother Tongue

Offline

 

#8 2010-06-14 15:23:14

fcbleos
New Scratcher
Registered: 2010-06-14
Posts: 5

Re: Reset Timer @each new Level

Wolfie1996 wrote:

I have another idea - I'll upload a project with it on in a while (I have to go for a few minutes) I'll give yo the link when I'm done  smile

Would be great:)

Thanks a lot dude;)

Offline

 

#9 2010-06-14 15:30:40

Wolfie1996
Retired Community Moderator
Registered: 2009-07-08
Posts: 1000+

Re: Reset Timer @each new Level


"...Jargon - the practice of never calling a spade a spade, when you might instead call it a manual earth-restructing implement..." - Bill Bryson, Mother Tongue

Offline

 

#10 2010-06-14 15:54:30

fcbleos
New Scratcher
Registered: 2010-06-14
Posts: 5

Re: Reset Timer @each new Level

Wolfie1996 wrote:

http://scratch.mit.edu/projects/blueshadow/1124269

big_smile  Is this what you need?

Seems to work with ur prog, but with my prog there always comes the "You Lost" Screen immediately. Could you be so kind and take a look an my Parking Lot3 Prog? Thought i did everything right^^

Thanks a lot:)

Offline

 

#11 2010-06-15 03:12:22

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

Re: Reset Timer @each new Level

fcbleos wrote:

Wolfie1996 wrote:

http://scratch.mit.edu/projects/blueshadow/1124269

big_smile  Is this what you need?

Seems to work with ur prog, but with my prog there always comes the "You Lost" Screen immediately. Could you be so kind and take a look an my Parking Lot3 Prog? Thought i did everything right^^

Thanks a lot:)

Use the blue timer and make it so the YOU LOST screen appears every time the timer reaches 10, and then put a reset timer block everytime a new level starts.

<reset timer>


http://i.imgur.com/gp6tZ.gif

Offline

 

Board footer