Hazme un juego cacheton
- User
Hazme un juego cacheton
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Hazme un juego cacheton
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Aquí tienes un juego de "Cachetes Locos" donde debes hacer clic en los cachetes que aparecen antes de que se termine el tiempo:
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Juego de Cachetes Locos</title>
<style>
body {
font-family: 'Comic Sans MS', cursive;
background: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 100%);
min-height: 100vh;
margin: 0;
display: flex;
flex-direction: column;
align-items: center;
padding: 20px;
}
.game-container {
text-align: center;
background: rgba(255, 255, 255, 0.9);
padding: 20px;
border-radius: 20px;
box-shadow: 0 10px 30px rgba(0,0,0,0.2);
max-width: 800px;
width: 90%;
}
h1 {
color: #ff6b6b;
text-shadow: 2px 2px 0 #fff;
margin-bottom: 30px;
}
.stats {
display: flex;
justify-content: space-around;
font-size: 1.5em;
margin: 20px 0;
color: #ff6b6b;
}
#game-area {
position: relative;
height: 500px;
border: 3px dashed #ff6b6b;
border-radius: 15px;
margin: 20px auto;
overflow: hidden;
background: #fff;
}
.cheek {
position: absolute;
width: 80px;
height: 80px;
background: #ff9a9e;
border-radius: 50%;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 5px 15px rgba(0,0,0,0.2);
transition: transform 0.1s;
}
.cheek::before {
content: "🥺";
font-size: 40px;
}
.cheek:hover {
transform: scale(1.1);
}
button {
background: #ff6b6b;
color: white;
border: none;
padding: 15px 30px;
font-size: 1.2em;
border-radius: 25px;
cursor: pointer;
transition: all 0.3s;
font-family: inherit;
margin-top: 20px;
}
button:hover {
background: #ff5252;
transform: scale(1.05);
}
.final-score {
color: #ff6b6b;
font-size: 2em;
margin: 20px 0;
text-shadow: 1px 1px 0 #fff;
}
</style>
</head>
<body>
<div class="game-container">
<h1>¡Cachetes Locos! 🎮</h1>
<div class="stats">
<div>Puntuación: <span id="score">0</span></div>
<div>Tiempo: <span id="time">30</span>s</div>
</div>
<div id="game-area"></div>
<button id="start-btn">¡Empezar a jugar! 😜</button>
<div class="final-score" id="final-score"></div>
</div>
<script>
let score = 0;
let timeLeft = 30;
let gameInterval;
let cheekInterval;
const startBtn = document.getElementById('start-btn');
const gameArea = document.getElementById('game-area');
startBtn.addEventListener('click', startGame);
function startGame() {
score = 0;
timeLeft = 30;
updateScore();
document.getElementById('final-score').textContent = '';
startBtn.disabled = true;
// Limpiar juego anterior
gameArea.innerHTML = '';
// Temporizador principal
gameInterval = setInterval(() => {
timeLeft--;
updateTime();
if (timeLeft <= 0) endGame();
}, 1000);
// Generación de cachetes
cheekInterval = setInterval(() => {
createCheek();
}, 800);
// Asegurar que el juego termine a los 30s
setTimeout(endGame, 30000);
}
function createCheek() {
const cheek = document.createElement('div');
cheek.className = 'cheek';
// Posición aleatoria
const maxX = gameArea.clientWidth - 80;
const maxY = gameArea.clientHeight - 80;
const left = Math.random() * maxX;
const top = Math.random() * maxY;
cheek.style.left = `${left}px`;
cheek.style.top = `${top}px`;
// Evento de clic
cheek.addEventListener('click', () => {
score++;
updateScore();
cheek.remove();
// Efecto de partícula (opcional)
createParticles(left + 40, top + 40);
});
gameArea.appendChild(cheek);
}
function updateScore() {
document.getElementById('score').textContent = score;
}
function updateTime() {
document.getElementById('time').textContent = timeLeft;
}
function endGame() {
clearInterval(gameInterval);
clearInterval(cheekInterval);
startBtn.disabled = false;
document.getElementById('final-score').textContent =
`¡Juego terminado! Puntuación final: ${score} 🏆`;
}
// Efecto de partículas al hacer clic (opcional)
function createParticles(x, y) {
for(let i = 0; i < 5; i++) {
const particle = document.createElement('div');
particle.style.cssText = `
position: absolute;
width: 10px;
height: 10px;
background: #ff9a9e;
border-radius: 50%;
left: ${x}px;
top: ${y}px;
opacity: 1;
`;
gameArea.appendChild(particle);
// Animación
setTimeout(() => {
particle.style.transition = 'all 0.5s';
particle.style.transform = `translate(${Math.random()*100-50}px, ${Math.random()*100-50}px)`;
particle.style.opacity = '0';
setTimeout(() => particle.remove(), 500);
}, 10);
}
}
</script>
</body>
</html>
Este juego incluye:
Para jugar:
El juego tiene un estilo cartoon con colores pastel y emojis, y funciona en cualquier navegador moderno. Los cachetes aparecen cada 800ms en posiciones aleatorias del área de juego.