1 00:00:00,000 --> 00:00:10,000 Hello, in this video tutorial we are going to include a countdown so you have a limited time to cross the maze. 2 00:00:11,000 --> 00:00:27,000 We are going to use a countdown, we have to use a variable so we can store the time that is going by. 3 00:00:27,000 --> 00:00:40,000 So we will create a variable, by making a variable I am going to call it timeLeft 4 00:00:41,000 --> 00:00:59,000 and I will set an initial value at the beginning so I am going to give myself a timeLeft of let's say 1 minute 5 00:01:00,000 --> 00:01:05,000 so I am going to use 60 because I am going to count in seconds, right? 6 00:01:05,000 --> 00:01:07,000 Ok? 7 00:01:08,000 --> 00:01:16,000 Now, how do I count in seconds? The simplest way would be to use a wait. 8 00:01:17,000 --> 00:01:24,000 Under something there is also a timer here, see if you put a timer it starts counting from the beginning 9 00:01:25,000 --> 00:01:32,000 but it is simpler if you just use the control block wait one second. 10 00:01:32,000 --> 00:01:44,000 So, what I can do is any time a second goes by I will decrease the value of timeLeft by 1 11 00:01:45,000 --> 00:01:59,000 so I go into variables and change my variable timeLeft by minus 1 12 00:01:59,000 --> 00:02:13,000 and that has to go on forever since the beginning 13 00:02:14,000 --> 00:02:25,000 Well, I am going to remove the timer from there by going to sensing and remove the tick here 14 00:02:34,000 --> 00:02:38,000 I have to stop it for this to work 15 00:02:39,000 --> 00:02:47,000 Now, there it goes. My mouse is not working so well. 16 00:02:48,000 --> 00:02:55,000 Now, I want to have the timeLeft on the screen so under variables I do have the timeLeft tick 17 00:02:56,000 --> 00:03:03,000 See? I tick it so I can watch the timeLeft. I can place this somewhere else too 18 00:03:04,000 --> 00:03:10,000 Right there or here. Now. 19 00:03:11,000 --> 00:03:22,000 Well, let's say now when I start the time starts at 60 and becomes counting down 20 00:03:23,000 --> 00:03:29,000 So, what I want to know is if I have run out of time or not 21 00:03:30,000 --> 00:03:34,000 So, I have to ask with an if 22 00:03:35,000 --> 00:03:39,000 So, I say if 23 00:03:40,000 --> 00:03:52,000 and now I ask if it has gone all the way to 0 with an equal here 24 00:03:53,000 --> 00:03:59,000 and what goes to 0 is the timeLeft 25 00:04:00,000 --> 00:04:06,000 and I place here what I want to happen when I run out of time 26 00:04:07,000 --> 00:04:18,000 You can make a block here like dine or you can include a new variable for lives and subtract one life 27 00:04:19,000 --> 00:04:27,000 or you can just make it go back to the initial position like this 28 00:04:28,000 --> 00:04:30,000 wherever you want 29 00:04:31,000 --> 00:04:38,000 So, that's the way you include a countdown 30 00:04:39,000 --> 00:04:43,000 so you have unlimited time to cross the maze 31 00:04:44,000 --> 00:04:45,000 Thank you