Click here for free DL of the app version that can save data.
No:2640 3844
Prev Next
Work out
Developer anonymous|Date and time 70/1/1 9:51:08
Build time unknown sec|Game capacity 3.068KB|Script

🚊🚋🚋🚋🚋🚋🚋🚋🚋🚋

¡Bienvenido al juego de trenes! 🎉

🕹️ Reglas del juego:
- Tienes que mover los trenes para que puedan salir de la estación.
- Debes moverlos de tal manera que no choquen entre sí.
- Tienes que mover el tren rojo hasta la salida primero para ganar.

🎮 Instrucciones:
- Haz clic en el tren que quieres mover.
- Mantén presionado y arrastra el tren en la dirección que deseas moverlo.
- Sigue moviendo los trenes hasta que puedas sacar el tren rojo.

¡Buena suerte! 🤞

HTML: 

Juego de Trenes 🚆

🟢🟢🟢🟢🟢🟢 🟢🟢🟢🟢🟢🟢 🟢🟢🔴🟢🟢🟢 🟢🟢🟢🟢🟢🟢 🟢🟢🟢🟢🟢🟢 🟢🟢🟢🟢🟢🟢
🚪
🚂
🚋
🚋
🚋
🚋

JavaScript: let trenRojo = document.getElementById(”tren-rojo”); let trenAmarillo = document.getElementById(”tren-amarillo”); let trenMorado = document.getElementById(”tren-morado”); let trenVerde = document.getElementById(”tren-verde”); let trenNaranja = document.getElementById(”tren-naranja”); let estacion = [ [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0], [0, 0, 1, 0, 0, 0], [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0] ]; let filaRojo = 2; let columnaRojo = 2; trenRojo.addEventListener(”mousedown”, inicioArrastre); trenRojo.addEventListener(”mouseup”, finArrastre); function inicioArrastre() { document.addEventListener(”mousemove”, moverTren); } function finArrastre() { document.removeEventListener(”mousemove”, moverTren); let tren = estacion[filaRojo][columnaRojo]; if (tren == 2) { estacion[filaRojo][columnaRojo] = 0; estacion[filaRojo][0] = 2; filaRojo = 2; columnaRojo = 0; console.log(estacion); if (ganar()) { alertHisa("¡Has ganado!"); } } } function moverTren(evento) { trenRojo.style.left = evento.clientX + "px"; trenRojo.style.top = evento.clientY + "px"; let fila = Math.floor(evento.clientY / 100); let columna = Math.floor(evento.clientX / 100); if (estacion[fila][columna] == 0) { estacion[filaRojo][columnaRojo] = 0; estacion[fila][columna] = 2; filaRojo = fila; columnaRojo = columna; console.log(estacion); } } function ganar() { let salida = estacion[2][0]; if (salida == 2) { return true; } return false; }


*This prompt didn't get me into the game this time. Plz try to generate it a few times.
Prev Next   Back  0  0 Menu 

[PR]現在の人気グッズランキング

Click here for free DL of the app version that can save data.

(C)2023 HisashiApp