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
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
Offline
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
![]()
http://scratch.mit.edu/projects/fcbleos/1124174
Here you are and thanks for your efforts.
Offline
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".
Offline
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
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
Offline
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
![]()
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
![]()
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
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
Offline
http://scratch.mit.edu/projects/blueshadow/1124269
Is this what you need?
Offline
Wolfie1996 wrote:
http://scratch.mit.edu/projects/blueshadow/1124269
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
fcbleos wrote:
Wolfie1996 wrote:
http://scratch.mit.edu/projects/blueshadow/1124269
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>
Offline