Activa JavaScript para disfrutar de los vídeos de la Mediateca.
13 comparing - 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:
in this tutorial we are going to
00:00:00
use logic comparisons these are comparisons for
00:00:02
which the outcomes true or false first
00:00:05
we go to operators and we select
00:00:08
this script here we compare only ask
00:00:10
is the last number less than the
00:00:14
right number and the answer is either
00:00:16
true or false
00:00:18
the next one is greater than we
00:00:20
ask as the last number greater than
00:00:22
the right number and the answer is
00:00:24
true or false the next one is
00:00:26
an equal comparison we ask is the
00:00:28
last number the same value as the
00:00:30
right number and the answer will be
00:00:32
true or false we can use the
00:00:34
outcome of these comparisons to control some
00:00:36
actions so to do this
00:00:38
we need to go to motion and select turn
00:00:40
clockwise and next from the control menu
00:00:42
we will need forever and if then
00:00:46
finally from sensing we want to use
00:00:53
distance to also don't forget to click
00:00:56
the green flag
00:01:00
first of all we want to turn
00:01:04
the sprite continuously for example one degree
00:01:06
at a time forever
00:01:09
here you can see that the sprite
00:01:12
continuously turns without any type of control
00:01:14
now we want to make the sprite
00:01:25
turn when a certain condition is true
00:01:27
for example
00:01:30
we can use the less than operation
00:01:34
and distance to mouse pointer less than
00:01:37
for example ninety then turn one degrees
00:01:40
the distance to the sprite is measured
00:01:45
from this point and this example we
00:01:48
can see zero zero ninety here
00:01:50
is
00:01:53
equal to three boxes so when the
00:01:53
mouse is more than three boxes away
00:01:56
from the script it will not turn
00:01:58
the as you could see when we
00:02:00
bring them as close to the sprite
00:02:01
it starts to rotate and when we move it
00:02:03
away it stops
00:02:06
next we can try another comparison if
00:02:12
we use the more than
00:02:15
so if the distance to the mouse
00:02:17
pointer is more than here you can
00:02:20
see that if the mouse is close
00:02:23
to the sprite it doesn't move but
00:02:25
when the mouse moves further away from
00:02:26
the sprite it starts to move
00:02:28
the last comparison is equal to the
00:02:35
distance has to be exact for the
00:02:38
sprite to move
00:02:40
let's choose ninety again
00:02:42
so here we can see that the
00:02:50
mouse has to be exactly three boxes
00:02:52
away otherwise the sprite will not rotate
00:02:55
this is quite tricky to find
00:03:04
so here we have seen how to
00:03:21
use comparisons of less than greater than
00:03:23
and equal to
00:03:26
- Idioma/s:
- Autor/es:
- David Gonzalez Arroyo
- Subido por:
- David G.
- Licencia:
- Reconocimiento - No comercial - Compartir igual
- Visualizaciones:
- 177
- Fecha:
- 22 de febrero de 2021 - 14:51
- Visibilidad:
- Público
- Centro:
- IES MARIE CURIE Loeches
- Duración:
- 03′ 31″
- Relación de aspecto:
- 1.78:1
- Resolución:
- 1280x720 píxeles
- Tamaño:
- 30.93 MBytes