Activa JavaScript para disfrutar de los vídeos de la Mediateca.
Maze 02 - Contenido educativo
Ajuste de pantallaEl ajuste de pantalla se aprecia al ver el vídeo en pantalla completa. Elige la presentación que más te guste:
Hello, in this video tutorial we are going to include a countdown so you have a limited time to cross the maze.
00:00:00
We are going to use a countdown, we have to use a variable so we can store the time that is going by.
00:00:11
So we will create a variable, by making a variable I am going to call it timeLeft
00:00:27
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
00:00:41
so I am going to use 60 because I am going to count in seconds, right?
00:01:00
Ok?
00:01:05
Now, how do I count in seconds? The simplest way would be to use a wait.
00:01:08
Under something there is also a timer here, see if you put a timer it starts counting from the beginning
00:01:17
but it is simpler if you just use the control block wait one second.
00:01:25
So, what I can do is any time a second goes by I will decrease the value of timeLeft by 1
00:01:32
so I go into variables and change my variable timeLeft by minus 1
00:01:45
and that has to go on forever since the beginning
00:01:59
Well, I am going to remove the timer from there by going to sensing and remove the tick here
00:02:14
I have to stop it for this to work
00:02:34
Now, there it goes. My mouse is not working so well.
00:02:39
Now, I want to have the timeLeft on the screen so under variables I do have the timeLeft tick
00:02:48
See? I tick it so I can watch the timeLeft. I can place this somewhere else too
00:02:56
Right there or here. Now.
00:03:04
Well, let's say now when I start the time starts at 60 and becomes counting down
00:03:11
So, what I want to know is if I have run out of time or not
00:03:23
So, I have to ask with an if
00:03:30
So, I say if
00:03:35
and now I ask if it has gone all the way to 0 with an equal here
00:03:40
and what goes to 0 is the timeLeft
00:03:53
and I place here what I want to happen when I run out of time
00:04:00
You can make a block here like dine or you can include a new variable for lives and subtract one life
00:04:07
or you can just make it go back to the initial position like this
00:04:19
wherever you want
00:04:28
So, that's the way you include a countdown
00:04:31
so you have unlimited time to cross the maze
00:04:39
Thank you
00:04:44
- Valoración:
- Eres el primero. Inicia sesión para valorar el vídeo.
- 1
- 2
- 3
- 4
- 5
- Idioma/s:
- Autor/es:
- Juan Carlos Alonso de Mena
- Subido por:
- Juan Carlos A.
- Licencia:
- Reconocimiento - No comercial
- Visualizaciones:
- 15
- Fecha:
- 5 de noviembre de 2023 - 12:09
- Visibilidad:
- Público
- Centro:
- IES ALPEDRETE
- Duración:
- 04′ 46″
- Relación de aspecto:
- 16:10 El estándar usado por los portátiles de 15,4" y algunos otros, es ancho como el 16:9.
- Resolución:
- 1920x1200 píxeles
- Tamaño:
- 15.33 MBytes