Subir archivos a "/"
Archivos iniciales
This commit is contained in:
+25
@@ -0,0 +1,25 @@
|
||||
|
||||
//La movemos cada 1000ms
|
||||
setInterval(moverGallina, 500);
|
||||
|
||||
//InnerHeight y Width pa que no se salva de la pantalla.
|
||||
function moverGallina() {
|
||||
let top = Math.floor(Math.random() * (innerHeight - 100 + 1) + 100);
|
||||
let right = Math.floor(Math.random() * (innerHeight - 100 + 1) + 100);
|
||||
let bottom = Math.floor(Math.random() * innerWidth + 100);
|
||||
let left = Math.floor(Math.random() * (innerWidth - 100 + 1) + 100);
|
||||
|
||||
//Lo de las comillas y el dolar dolor de wevos
|
||||
document.getElementById("gallina").style.margin =
|
||||
`${top}px ${right}px ${bottom}px ${left}px`;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function ganar(){
|
||||
alert('¡Has pillado a la gallina!');
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user