최대한 간단한 게임은 어떤 모습일지 생각해 보았읍니다.
미니멀리즘의 정수라고 할 수 잇읍니다
가능한 한 오래 버티는게 목적인 게임입니다.
HTML과 자바스크립트로 만들었읍니다.
<html>
<head>
<meta charset="utf-8">
<title>光ㄹ(beta)</title>
<input type="button" id="id버튼" value="?" style="width:80px; height:80px; absolute; left:100px; top:100px; font-size:1.5em;"></button>
</head>
<body>
<script>
let 반복
let 목숨 = 200
let 클릭 = function() {
clearInterval(반복)
목숨 += 11
document.getElementById(`id버튼`).value = 목숨
반복 = setInterval(깎,65)}
let 깎 = function() {
목숨 -= 10
document.getElementById(`id버튼`).value = 목숨
if (목숨<=0) {
목숨 = 200
document.getElementById(`id버튼`).value = 목숨
clearInterval(반복)}}
document.getElementById(`id버튼`).value = 목숨
document.getElementById(`id버튼`).>
</script>
</body>
</html>
댓글 0