以下が「💩パニック」の実装例です。
```html
<!DOCTYPE html>
<html>
<head>
<title>💩パニック</title>
<style>
#stage {
width: 350px;
height: 350px;
background-color: white;
position: relative;
}
.poo {
position: absolute;
width: 30px;
height: 30px;
background-image: url('poo.png');
background-size: cover;
cursor: pointer;
}
#game-over {
display: none;
}
</style>
</head>
<body>
<h1>💩パニック</h1>
<div id="stage"></div>
<div id="game-over">
<h2>ゲームオーバー</h2>
<button onclick="restartGame()">再挑戦</button>
</div>
<script>
var score = 0;
var pooCount = 0;
var speed = 1000;
function createPoo() {
var stage = document.getElementById('stage');
var poo = document.createElement('div');
poo.className = 'poo';
poo.style.left = Math.floor(Math.random() * 320) + 'px';
poo.style.top = Math.floor(Math.random() * 320) + 'px';
poo.onclick = function() {
stage.removeChild(poo);
score += 1;
document.body.removeChild(scoreElement);
showScore();
pooCount -= 1;
};
stage.appendChild(poo);
pooCount += 1;
checkGameOver();
}
function checkGameOver() {
if (pooCount >= 8) {
var gameOver = document.getElementById('game-over');
gameOver.style.display = 'block';
clearInterval(pooInterval);
alert("💩: 'ゲームオーバーだよ!'");
}
}
function restartGame() {
var stage = document.getElementById('stage');
while (stage.firstChild) {
stage.firstChild.onclick = null;
stage.removeChild(stage.firstChild);
}
score = 0;
pooCount = 0;
speed = 1000;
document.body.removeChild(scoreElement);
showScore();
var gameOver = document.getElementById('game-over');
gameOver.style.display = 'none';
startGame();
}
function showScore() {
scoreElement = document.createElement('p');
scoreElement.innerText = 'Score: ' + score;
document.body.appendChild(scoreElement);
}
function startGame() {
showScore();
pooInterval = setInterval(function() {
createPoo();
}, speed);
}
startGame();
</script>
</body>
</html>
```
※ 上記のコードでは `poo.png` という名前の画像ファイルが必要です。任意の画像を `poo.png` として同じディレクトリに用意してください。
ジョーク要素として、ゲームオーバー時に `alert("💩: 'ゲームオーバーだよ!'");` のように `alert` を使用してメッセージを表示させています。また、ゲームオーバー時に「💩: 'ゲームオーバーだよ!'」というジョークも追加しました。任意で変更や削除してください。