{"id":635,"date":"2025-08-19T10:21:20","date_gmt":"2025-08-19T01:21:20","guid":{"rendered":"https:\/\/momospace.org\/?page_id=635"},"modified":"2025-10-12T17:00:29","modified_gmt":"2025-10-12T08:00:29","slug":"%ec%95%84%ec%bc%80%ec%9d%b4%eb%93%9c-%ea%b2%8c%ec%9e%84%ec%a1%b4","status":"publish","type":"page","link":"https:\/\/momospace.org\/?page_id=635","title":{"rendered":"\uc544\ucf00\uc774\ub4dc \uac8c\uc784\uc874"},"content":{"rendered":"\n<!DOCTYPE html>\n<html lang=\"ko\">\n<head>\n  <meta charset=\"UTF-8\" \/>\n  <title>\ubcbd\ub3cc \uae68\uae30 \uac8c\uc784 &#8211; \ubc18\uc751\ud615 \ubc0f \ud130\uce58 \uc9c0\uc6d0<\/title>\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no\">\n  <style>\n    @import url('https:\/\/fonts.googleapis.com\/css2?family=Inter:wght@400;700&display=swap');\n    \/* Tailwind inspired color variables *\/\n    :root {\n      --color-bg: #f0f4f8;\n      --color-fg: #1e293b;\n      --color-container-bg: #fff;\n      --color-container-border: #e2e8f0;\n      --color-heading: #334155;\n      --color-canvas-bg: #161c30;\n      --color-info-text: #475569;\n      --color-button-bg: #4a5568;\n      --color-button-hover-bg: #2d3748;\n      --color-ball: #facc15; \/* yellow-400 *\/\n      --color-paddle: #2563eb; \/* blue-600 *\/\n      --color-brick: #34d399; \/* emerald-400 *\/\n      --color-message-win: #10b981; \/* emerald-600 *\/\n      --color-message-lose: #ef4444; \/* red-500 *\/\n      --color-mobile-btn-bg: #3b82f6;\n      --color-mobile-btn-hover: #2563eb;\n    }\n    body {\n      background: var(--color-bg);\n      margin: 0; padding: 0;\n      font-family: 'Inter', sans-serif;\n      display: flex;\n      justify-content: center;\n      align-items: center;\n      min-height: 100vh;\n      box-sizing: border-box;\n    }\n    .game-container {\n      background-color: var(--color-container-bg);\n      border-radius: 1.5rem;\n      box-shadow: 0 10px 25px rgba(0,0,0,0.15);\n      padding: 1.5rem 1rem 2rem;\n      max-width: 600px;\n      width: 95vw;\n      margin: 1rem auto; \/* Adjusted margin for better mobile fit *\/\n      box-sizing: border-box;\n      border: 2px solid var(--color-container-border);\n      position: relative;\n      user-select: none;\n    }\n    h1 {\n      color: var(--color-heading);\n      font-weight: 700;\n      font-size: 1.4rem;\n      margin-bottom: 1rem;\n      text-align: center;\n    }\n    canvas {\n      \/* Physics are fixed to 560x400, but CSS scales it visually *\/\n      width: 100%;\n      height: auto;\n      aspect-ratio: 560 \/ 400; \/* Maintain aspect ratio *\/\n      border-radius: 1rem;\n      background-color: var(--color-canvas-bg);\n      border: 2px solid var(--color-container-border);\n      display: block;\n      margin: 0 auto;\n      touch-action: none; \/* Prevents default mobile scrolling\/zooming *\/\n    }\n    .game-info {\n      display: flex;\n      justify-content: space-between;\n      margin-top: 1rem;\n      font-weight: 600;\n      font-size: 1.05rem;\n      color: var(--color-info-text);\n      user-select: none;\n    }\n    .controls, .mobile-controls {\n      display: flex;\n      justify-content: center;\n      gap: 1.2rem;\n      margin-top: 1.5rem;\n      user-select: none;\n      flex-wrap: wrap;\n    }\n    .control-button, .mobile-control-button {\n      border-radius: 0.75rem;\n      background-color: var(--color-button-bg);\n      color: white;\n      font-weight: 600;\n      cursor: pointer;\n      box-shadow: 0 4px 6px rgba(0,0,0,0.1);\n      border: none;\n      transition: background-color 0.3s ease, box-shadow 0.2s ease, transform 0.2s ease;\n      display: flex;\n      justify-content: center;\n      align-items: center;\n      user-select: none;\n      -webkit-tap-highlight-color: transparent;\n      outline: none; \/* remove focus outline on tap *\/\n    }\n    .control-button {\n      padding: 0.75rem 1.7rem;\n      font-size: 1rem;\n      min-width: 90px;\n    }\n    .mobile-controls {\n        display: none; \/* Hide by default on large screens *\/\n    }\n    @media (max-width: 600px) {\n        \/* Show mobile controls and hide desktop controls on small screens *\/\n        .controls { display: none; }\n        .mobile-controls { display: flex; }\n    }\n    .mobile-control-button {\n      font-size: 1.7rem;\n      width: 55px;\n      height: 55px;\n      padding: 0;\n      background-color: var(--color-mobile-btn-bg); \/* Use distinct color for mobile controls *\/\n    }\n    .control-button:hover,\n    .mobile-control-button:hover {\n      background-color: var(--color-button-hover-bg);\n      box-shadow: 0 6px 8px rgba(0,0,0,0.15);\n      transform: translateY(-2px);\n    }\n    .control-button:active,\n    .mobile-control-button:active {\n      background-color: var(--color-button-hover-bg);\n      box-shadow: 0 2px 4px rgba(0,0,0,0.1);\n      transform: translateY(0);\n    }\n    .message-box {\n      position: absolute;\n      \/* \uba54\uc2dc\uc9c0 \ubc15\uc2a4\ub97c \uce94\ubc84\uc2a4 \uc601\uc5ed\ub9cc \ub36e\ub3c4\ub85d \uc870\uc815 *\/\n      top: 0;\n      left: 0;\n      width: 100%;\n      height: 100%;\n      display: flex;\n      justify-content: center;\n      align-items: center;\n      background: rgba(22, 28, 48, 0.9); \/* Dark overlay matching canvas bg *\/\n      border-radius: 1.5rem;\n      color: white;\n      font-size: 1.6rem;\n      font-weight: 700;\n      z-index: 200;\n      pointer-events: none; \/* \uae30\ubcf8\uc801\uc73c\ub85c \ud074\ub9ad \uc774\ubca4\ud2b8\ub97c \ud1b5\uacfc\uc2dc\ud0b4 *\/\n      text-align: center;\n      user-select: none;\n      transition: opacity 0.3s ease;\n      opacity: 0; \/* Hidden by default *\/\n      padding: 1rem;\n      box-sizing: border-box;\n    }\n    .message-box.show {\n        opacity: 1;\n        \/* \ud074\ub9ad \uc774\ubca4\ud2b8 \ud65c\uc131\ud654\ub294 JS\uc5d0\uc11c \ub3d9\uc801\uc73c\ub85c \ucc98\ub9ac *\/\n    }\n    \/* \ubc18\uc751\ud615 \ud14d\uc2a4\ud2b8 \ubc0f \ubc84\ud2bc \ud06c\uae30 \uc870\uc815 *\/\n    @media (max-width: 400px) {\n      h1 { font-size: 1.2rem; }\n      .control-button {\n        padding: 0.6rem 1.1rem;\n        font-size: 0.9rem;\n        min-width: 70px;\n      }\n      .mobile-control-button {\n        width: 48px;\n        height: 48px;\n        font-size: 1.4rem;\n      }\n      .game-info { font-size: 0.92rem; }\n      .game-container {\n        padding: 1rem 0.8rem 1.5rem;\n        margin: 1.2rem auto;\n      }\n    }\n  <\/style>\n<\/head>\n<body>\n  <div class=\"game-container\" role=\"main\" aria-label=\"\ubcbd\ub3cc \uae68\uae30 \uac8c\uc784\">\n    <h1>\ubcbd\ub3cc \uae68\uae30 \uac8c\uc784<\/h1>\n    <!-- Fixed dimensions are used for physics consistency, CSS handles visual scaling -->\n    <canvas id=\"myGameCanvas\" width=\"560\" height=\"400\" aria-label=\"\ubcbd\ub3cc \uae68\uae30 \uac8c\uc784 \uce94\ubc84\uc2a4\"><\/canvas>\n    <div class=\"game-info\" aria-live=\"polite\" aria-atomic=\"true\">\n      <span id=\"score\">\uc810\uc218: 0<\/span>\n      <span id=\"lives\">\ubaa9\uc228: 3<\/span>\n      <span id=\"level\">\ub808\ubca8: 1<\/span>\n    <\/div>\n    <!-- \ub370\uc2a4\ud06c\ud1b1\uc6a9 \uc81c\uc5b4 \ubc84\ud2bc -->\n    <div class=\"controls\" role=\"group\" aria-label=\"\ub370\uc2a4\ud06c\ud1b1 \uac8c\uc784 \uc81c\uc5b4 \ubc84\ud2bc\">\n      <button class=\"control-button\" id=\"start-btn\" aria-pressed=\"false\">\uc2dc\uc791<\/button>\n      <button class=\"control-button\" id=\"restart-btn\" aria-pressed=\"false\">\uc7ac\uc2dc\uc791<\/button>\n    <\/div>\n    <!-- \ubaa8\ubc14\uc77c\/\ud130\uce58\uc6a9 \uc81c\uc5b4 \ubc84\ud2bc -->\n    <div class=\"mobile-controls\" role=\"group\" aria-label=\"\ubaa8\ubc14\uc77c \uc870\uc791 \ubc84\ud2bc\">\n      <button class=\"mobile-control-button\" id=\"left-btn\" aria-label=\"\uc67c\ucabd \uc774\ub3d9\">\u25c0<\/button>\n      <button class=\"mobile-control-button\" id=\"right-btn\" aria-label=\"\uc624\ub978\ucabd \uc774\ub3d9\">\u25b6<\/button>\n    <\/div>\n    <!-- \uba54\uc2dc\uc9c0 \ubc15\uc2a4: \uc774 \uc694\uc18c\ub294 game-container \ub0b4\ubd80\uc5d0 \uc788\uc9c0\ub9cc, \uce94\ubc84\uc2a4 \uc601\uc5ed\uc744 \ub36e\uc2b5\ub2c8\ub2e4. -->\n    <div class=\"message-box\" id=\"message-box\" role=\"alert\" aria-live=\"assertive\"><\/div>\n  <\/div>\n  <script>\n    (function() {\n      const CANVAS_WIDTH = 560;\n      const CANVAS_HEIGHT = 400;\n      const MAX_BALL_SPEED = 4;\n\n      window.onload = function() {\n        const canvas = document.getElementById('myGameCanvas');\n        if (!canvas) {\n          console.error(\"Canvas element not found!\");\n          return;\n        }\n        \n        canvas.width = CANVAS_WIDTH;\n        canvas.height = CANVAS_HEIGHT;\n\n        const ctx = canvas.getContext('2d');\n        const messageBox = document.getElementById('message-box');\n        const startButton = document.getElementById('start-btn');\n        const restartButton = document.getElementById('restart-btn');\n        const leftButton = document.getElementById('left-btn');\n        const rightButton = document.getElementById('right-btn');\n        const scoreElement = document.getElementById('score');\n        const livesElement = document.getElementById('lives');\n        const levelElement = document.getElementById('level');\n\n        let animationFrameId = null;\n        let isGameRunning = false;\n        let isSetupReady = false;\n\n        let score, lives, level;\n        let x, y, dx, dy, paddleX, paddleWidth, brickRowCount, brickColumnCount, bricks;\n\n        const ballRadius = 10;\n        const paddleHeight = 10;\n        const paddleSpeed = 8;\n        const brickWidth = 75;\n        const brickHeight = 20;\n        const brickPadding = 10;\n        const brickOffsetTop = 30;\n        const brickOffsetLeft = 30;\n\n        let rightPressed = false;\n        let leftPressed = false;\n        \n        function setupGameVariables(initial = false) {\n            score = 0;\n            lives = 3;\n            level = initial ? 1 : level;\n            \n            x = canvas.width \/ 2;\n            y = canvas.height - 30;\n            \n            let initialSpeed = 1.5 + (level - 1) * 0.2;\n            initialSpeed = Math.min(initialSpeed, MAX_BALL_SPEED);\n            dx = initialSpeed;\n            dy = -initialSpeed; \n\n            paddleWidth = 75; \n            paddleX = (canvas.width - paddleWidth) \/ 2;\n\n            \/\/ \ub808\ubca8\uc5d0 \ub530\ub77c \ubcbd\ub3cc \uc904 \uc99d\uac00 (\ucd5c\ub300 5\uc904)\n            brickRowCount = 3 + Math.min(level - 1, 2);\n            brickColumnCount = 5;\n\n            initBricks();\n            updateGameInfo();\n        }\n\n        function initBricks() {\n          bricks = [];\n          for(let c = 0; c < brickColumnCount; c++) {\n            bricks[c] = [];\n            for(let r = 0; r < brickRowCount; r++) {\n              bricks[c][r] = { x: 0, y: 0, status: 1 };\n            }\n          }\n        }\n        \n        function updateGameInfo() {\n            scoreElement.textContent = `\uc810\uc218: ${score}`;\n            livesElement.textContent = `\ubaa9\uc228: ${lives}`;\n            levelElement.textContent = `\ub808\ubca8: ${level}`;\n        }\n\n        \/\/ --- \uadf8\ub9ac\uae30 \ud568\uc218 ---\n        function drawBall() {\n          ctx.beginPath();\n          ctx.arc(x, y, ballRadius, 0, Math.PI * 2);\n          ctx.fillStyle = getComputedStyle(document.documentElement).getPropertyValue('--color-ball');\n          ctx.fill();\n          ctx.closePath();\n        }\n\n        function drawPaddle() {\n          ctx.beginPath();\n          ctx.rect(paddleX, canvas.height - paddleHeight, paddleWidth, paddleHeight);\n          ctx.fillStyle = getComputedStyle(document.documentElement).getPropertyValue('--color-paddle');\n          ctx.fill();\n          ctx.closePath();\n        }\n\n        function drawBricks() {\n          for(let c = 0; c < brickColumnCount; c++) {\n            for(let r = 0; r < brickRowCount; r++) {\n              if(bricks[c][r].status === 1) {\n                let brickX = (c * (brickWidth + brickPadding)) + brickOffsetLeft;\n                let brickY = (r * (brickHeight + brickPadding)) + brickOffsetTop;\n                bricks[c][r].x = brickX;\n                bricks[c][r].y = brickY;\n                ctx.beginPath();\n                ctx.rect(brickX, brickY, brickWidth, brickHeight);\n                ctx.fillStyle = getComputedStyle(document.documentElement).getPropertyValue('--color-brick');\n                ctx.fill();\n                ctx.closePath();\n              }\n            }\n          }\n        }\n\n        function collisionDetection() {\n          let totalBricks = brickRowCount * brickColumnCount;\n          let brokenBricks = 0;\n\n          for(let c = 0; c < brickColumnCount; c++) {\n            for(let r = 0; r < brickRowCount; r++) {\n              let b = bricks[c][r];\n              if(b.status === 1) {\n                if(x > b.x && x < b.x + brickWidth &#038;&#038; y > b.y && y < b.y + brickHeight) {\n                  dy = -dy;\n                  b.status = 0;\n                  score++;\n                  updateGameInfo();\n                }\n              } else {\n                  brokenBricks++;\n              }\n            }\n          }\n\n          if(brokenBricks === totalBricks) {\n              nextLevel();\n          }\n        }\n\n        function drawScene() {\n            ctx.clearRect(0, 0, canvas.width, canvas.height);\n            drawBricks();\n            drawBall();\n            drawPaddle();\n        }\n\n        function draw() {\n          if (!isGameRunning) {\n              if (animationFrameId) cancelAnimationFrame(animationFrameId);\n              return;\n          }\n\n          drawScene();\n          collisionDetection();\n\n          \/\/ 1. \uacf5 \ubcbd \ucda9\ub3cc\n          if(x + dx > canvas.width - ballRadius || x + dx < ballRadius) {\n            dx = -dx;\n          }\n          if(y + dy < ballRadius) {\n            dy = -dy;\n          } \n          \/\/ 2. \uacf5 \ud328\ub4e4\/\ubc14\ub2e5 \ucda9\ub3cc\n          else if(y + dy > canvas.height - ballRadius - paddleHeight) {\n            if(x + ballRadius > paddleX && x - ballRadius < paddleX + paddleWidth) {\n              \/\/ \ud328\ub4e4 \uc911\uc559\uc5d0\uc11c \ubc97\uc5b4\ub0a0\uc218\ub85d \uacf5\uc758 \uc218\ud3c9 \uc18d\ub3c4(dx) \uc99d\uac00 \ubc0f \ubc18\uc0ac\uac01 \uc801\uc6a9\n              const relativeIntersectX = (x - (paddleX + paddleWidth \/ 2));\n              const normalizedRelativeIntersectionX = relativeIntersectX \/ (paddleWidth \/ 2);\n              const bounceAngle = normalizedRelativeIntersectionX * (Math.PI \/ 3); \n              \n              const currentSpeed = Math.sqrt(dx * dx + dy * dy);\n              dx = currentSpeed * Math.sin(bounceAngle);\n              dy = -currentSpeed * Math.cos(bounceAngle); \n              \n            } else if (y + dy > canvas.height - ballRadius) {\n              \/\/ \ubc14\ub2e5\uc5d0 \ub2ff\uc74c (\ud328\ub4e4\ub85c \ubc1b\uc9c0 \ubabb\ud568)\n              lives--;\n              updateGameInfo();\n              if(lives <= 0) {\n                \/\/ \uac8c\uc784 \uc624\ubc84 \uc2dc \uce94\ubc84\uc2a4 \ud074\ub9ad \uc774\ubca4\ud2b8\ub3c4 \ub9c9\uc74c\n                showMessage(\"\uac8c\uc784 \uc624\ubc84! \ud83d\ude2d \ub2e4\uc2dc \uc2dc\ub3c4\ud558\uc138\uc694!\", false, true, false); \n                isGameRunning = false;\n                if (animationFrameId) cancelAnimationFrame(animationFrameId);\n                return;\n              } else {\n                \/\/ \uacf5 \uc7ac\ubc30\uce58 \ud6c4 \uc77c\uc2dc \uc815\uc9c0 (\uba54\uc2dc\uc9c0 \ubc15\uc2a4\ub294 1.3\ucd08 \ud6c4 \uc0ac\ub77c\uc9d0)\n                showMessage(`\ubaa9\uc228\uc774 ${lives}\uac1c \ub0a8\uc558\uc2b5\ub2c8\ub2e4.`, true, false, true); \n                isGameRunning = false;\n                x = canvas.width \/ 2;\n                y = canvas.height - 30;\n                paddleX = (canvas.width - paddleWidth) \/ 2;\n                \n                \/\/ 1.5\ucd08 \ud6c4 \uc7ac\uc2dc\uc791\n                setTimeout(() => {\n                    if (lives > 0) {\n                        isGameRunning = true;\n                        hideMessage();\n                        animationFrameId = requestAnimationFrame(draw);\n                    }\n                }, 1500);\n                return; \n              }\n            }\n          }\n\n          \/\/ 3. \ud328\ub4e4 \uc774\ub3d9\n          if(rightPressed && paddleX < canvas.width - paddleWidth) {\n            paddleX += paddleSpeed;\n          } else if(leftPressed &#038;&#038; paddleX > 0) {\n            paddleX -= paddleSpeed;\n          }\n\n          \/\/ 4. \uacf5 \uc704\uce58 \uc5c5\ub370\uc774\ud2b8\n          x += dx;\n          y += dy;\n\n          animationFrameId = requestAnimationFrame(draw);\n        }\n\n        function nextLevel() {\n          if(level < 5) {\n            isGameRunning = false;\n            if (animationFrameId) cancelAnimationFrame(animationFrameId);\n\n            level++;\n            setupGameVariables(false);\n\n            showMessage(`\ub808\ubca8 ${level} \uc2dc\uc791! \uacf5 \uc18d\ub3c4\uac00 \ube68\ub77c\uc9d1\ub2c8\ub2e4.`, true, false, false); \/\/ \ub808\ubca8 \uc5c5 \uba54\uc2dc\uc9c0 \ub3d9\uc548 \uc77c\uc2dc \uc815\uc9c0\n\n            \/\/ 1.5\ucd08 \ud6c4 \uc7ac\uc2dc\uc791\n            setTimeout(() => {\n              isGameRunning = true;\n              hideMessage();\n              animationFrameId = requestAnimationFrame(draw);\n            }, 1500);\n          } else {\n            \/\/ \uac8c\uc784 \uc2b9\ub9ac \uc2dc \uce94\ubc84\uc2a4 \ud074\ub9ad \uc774\ubca4\ud2b8 \ub9c9\uc74c\n            showMessage(\"\ucd95\ud558\ud569\ub2c8\ub2e4! \uac8c\uc784\uc744 \uc2b9\ub9ac\ud588\uc5b4\uc694! \ud83c\udf89\", true, true, false); \n            isGameRunning = false;\n            if (animationFrameId) cancelAnimationFrame(animationFrameId);\n          }\n        }\n\n        \/\/ --- UI \ubc0f \uc774\ubca4\ud2b8 \ud578\ub4e4\ub7ec ---\n        \/**\n         * \uba54\uc2dc\uc9c0\ub97c \ud45c\uc2dc\ud558\uace0 \ud3ec\uc778\ud130 \uc774\ubca4\ud2b8\ub97c \uc81c\uc5b4\ud569\ub2c8\ub2e4.\n         * @param {string} msg - \ud45c\uc2dc\ud560 \uba54\uc2dc\uc9c0\n         * @param {boolean} isWin - \uc2b9\ub9ac\/\ub808\ubca8\uc5c5 \uba54\uc2dc\uc9c0 \uc5ec\ubd80 (\uc0c9\uc0c1 \uacb0\uc815)\n         * @param {boolean} isFinal - \uc601\uad6c\uc801\uc73c\ub85c \ud45c\uc2dc\ub420 \uba54\uc2dc\uc9c0 (Game Over, Press Start)\n         * @param {boolean} canClickThrough - \uba54\uc2dc\uc9c0 \ubc15\uc2a4 \uc544\ub798 \uc694\uc18c(\ud2b9\ud788 \uce94\ubc84\uc2a4)\ub97c \ud074\ub9ad\ud560 \uc218 \uc788\ub3c4\ub85d \ud5c8\uc6a9\ud560\uc9c0 \uc5ec\ubd80\n         *\/\n        function showMessage(msg, isWin, isFinal = false, canClickThrough = false) {\n          messageBox.classList.add('show');\n          \n          let colorVar = isWin ? '--color-message-win' : '--color-message-lose';\n          \/\/ \ucd5c\uc885 \uba54\uc2dc\uc9c0\ub098 \uc0dd\uba85 \uac10\uc18c\uac00 \uc544\ub2d0 \uacbd\uc6b0 \uc911\ub9bd\uc801\uc778 \ud770\uc0c9 \uc0ac\uc6a9\n          if (!isFinal && msg.includes(\"\uc2dc\uc791\") === false && msg.includes(\"\ub0a8\uc558\uc2b5\ub2c8\ub2e4.\") === false) {\n              colorVar = 'white'; \n          }\n\n          messageBox.style.color = getComputedStyle(document.documentElement).getPropertyValue(colorVar);\n          messageBox.textContent = msg;\n          \n          \/\/ FIX: canClickThrough \ud50c\ub798\uadf8\ub97c \uc0ac\uc6a9\ud558\uc5ec \ud3ec\uc778\ud130 \uc774\ubca4\ud2b8\ub97c \uc81c\uc5b4\ud569\ub2c8\ub2e4.\n          \/\/ true\uc774\uba74 \ubc84\ud2bc \ud074\ub9ad \uac00\ub2a5, false\uc774\uba74 (\uac8c\uc784 \uc624\ubc84 \ub4f1) \uce94\ubc84\uc2a4 \uc0c1\ud638\uc791\uc6a9 \ubc29\uc9c0.\n          messageBox.style.pointerEvents = canClickThrough ? 'none' : 'auto';\n\n          \/\/ \ucd5c\uc885 \uba54\uc2dc\uc9c0 (Press Start, Game Over)\uac00 \uc544\ub2d0 \ub54c\ub9cc \uc9e7\uc740 \uc2dc\uac04 \ud6c4 \uc0ac\ub77c\uc9c0\ub3c4\ub85d \uc124\uc815\n          if (!isFinal) {\n             setTimeout(hideMessage, 1300);\n          }\n        }\n\n        function hideMessage() {\n          messageBox.classList.remove('show');\n          messageBox.style.pointerEvents = 'none'; \/\/ \uc228\uae38 \ub54c\ub294 \ud56d\uc0c1 none\n        }\n        \n        \/\/ \ud0a4\ubcf4\ub4dc, \ub9c8\uc6b0\uc2a4, \ud130\uce58 \uc774\ub3d9 \uc774\ubca4\ud2b8\ub294 \uadf8\ub300\ub85c \uc720\uc9c0\n        const keyDownHandler = (e) => {\n          if(e.key === \"Right\" || e.key === \"ArrowRight\") { rightPressed = true; } \n          else if(e.key === \"Left\" || e.key === \"ArrowLeft\") { leftPressed = true; }\n        }\n\n        const keyUpHandler = (e) => {\n          if(e.key === \"Right\" || e.key === \"ArrowRight\") { rightPressed = false; } \n          else if(e.key === \"Left\" || e.key === \"ArrowLeft\") { leftPressed = false; }\n        }\n\n        const mouseMoveHandler = (e) => {\n          const relativeX = e.clientX - canvas.getBoundingClientRect().left;\n          const canvasWidth = canvas.getBoundingClientRect().width;\n          const ratio = CANVAS_WIDTH \/ canvasWidth;\n          const gameX = relativeX * ratio;\n          \n          if(gameX > 0 && gameX < CANVAS_WIDTH) {\n            paddleX = gameX - paddleWidth\/2;\n            if(paddleX < 0) paddleX = 0;\n            if(paddleX > CANVAS_WIDTH - paddleWidth) paddleX = CANVAS_WIDTH - paddleWidth;\n          }\n        }\n        \n        const touchMoveHandler = (e) => {\n             if (e.touches.length > 0) {\n                const touch = e.touches[0];\n                const relativeX = touch.clientX - canvas.getBoundingClientRect().left;\n                const canvasWidth = canvas.getBoundingClientRect().width;\n\n                const ratio = CANVAS_WIDTH \/ canvasWidth;\n                const gameX = relativeX * ratio;\n\n                if (gameX > 0 && gameX < CANVAS_WIDTH) {\n                    paddleX = gameX - paddleWidth \/ 2;\n                    if (paddleX < 0) paddleX = 0;\n                    if (paddleX > CANVAS_WIDTH - paddleWidth) paddleX = CANVAS_WIDTH - paddleWidth;\n                }\n             }\n        }\n\n        \/\/ --- \uc774\ubca4\ud2b8 \ub9ac\uc2a4\ub108 \ub4f1\ub85d ---\n        document.addEventListener(\"keydown\", keyDownHandler, false);\n        document.addEventListener(\"keyup\", keyUpHandler, false);\n        document.addEventListener(\"mousemove\", mouseMoveHandler, false);\n        canvas.addEventListener(\"touchmove\", touchMoveHandler, false); \n\n        \/\/ \ubaa8\ubc14\uc77c \ubc84\ud2bc \ud130\uce58\/\ud074\ub9ad \uc774\ubca4\ud2b8\n        leftButton.addEventListener('touchstart', (e) => { e.preventDefault(); leftPressed = true; }, false);\n        leftButton.addEventListener('touchend', (e) => { e.preventDefault(); leftPressed = false; }, false);\n        rightButton.addEventListener('touchstart', (e) => { e.preventDefault(); rightPressed = true; }, false);\n        rightButton.addEventListener('touchend', (e) => { e.preventDefault(); rightPressed = false; }, false);\n        \n        leftButton.addEventListener('mousedown', () => { leftPressed = true; }, false);\n        leftButton.addEventListener('mouseup', () => { leftPressed = false; }, false);\n        rightButton.addEventListener('mousedown', () => { rightPressed = true; }, false);\n        rightButton.addEventListener('mouseup', () => { rightPressed = false; }, false);\n        leftButton.addEventListener('mouseleave', () => { leftPressed = false; }, false);\n        rightButton.addEventListener('mouseleave', () => { rightPressed = false; }, false);\n\n\n        \/\/ '\uc2dc\uc791' \ubc84\ud2bc\n        startButton.addEventListener('click', () => {\n          if (!isGameRunning) {\n            isGameRunning = true;\n            hideMessage();\n            animationFrameId = requestAnimationFrame(draw);\n          }\n        });\n\n        \/\/ '\uc7ac\uc2dc\uc791' \ubc84\ud2bc\n        restartButton.addEventListener('click', () => {\n          if(animationFrameId) cancelAnimationFrame(animationFrameId);\n          setupGameVariables(true); \n          drawScene(); \n          \/\/ \uc7ac\uc2dc\uc791 \ud6c4\uc5d0\ub294 '\uc2dc\uc791' \ubc84\ud2bc\uc744 \ub204\ub974\ub3c4\ub85d \uc720\ub3c4\ud558\uba70, \ud074\ub9ad\uc744 \ud5c8\uc6a9 (true)\n          showMessage(\"\uc2dc\uc791 \ubc84\ud2bc\uc744 \ub204\ub974\uac70\ub098 \ud654\uba74\uc744 \ud0ed\ud558\uc138\uc694!\", true, true, true); \n          isGameRunning = false;\n        });\n\n        \/\/ \uce94\ubc84\uc2a4 \ud0ed\uc73c\ub85c \uc2dc\uc791\/\uc77c\uc2dc\uc815\uc9c0 (\ubaa8\ubc14\uc77c\uc5d0\uc11c \uc720\uc6a9)\n        canvas.addEventListener('click', () => {\n             \/\/ isGameRunning\uc774 false\uc77c \ub54c\ub9cc \uc2dc\uc791 (\uc77c\uc2dc\uc815\uc9c0 \uae30\ub2a5\uc740 \uc544\ub2d8)\n             if (isSetupReady && !isGameRunning) {\n                 isGameRunning = true;\n                 hideMessage();\n                 animationFrameId = requestAnimationFrame(draw);\n             }\n        }, false);\n        \n        \/\/ --- \ucd08\uae30 \uc124\uc815 ---\n        setupGameVariables(true);\n        drawScene(); \n        \/\/ \ucd08\uae30 \uba54\uc2dc\uc9c0: isFinal=true(\uc601\uad6c \ud45c\uc2dc), canClickThrough=true(\ud074\ub9ad \ud5c8\uc6a9)\n        showMessage(\"\uc2dc\uc791 \ubc84\ud2bc\uc744 \ub204\ub974\uac70\ub098 \ud654\uba74\uc744 \ud0ed\ud558\uc138\uc694!\", true, true, true); \n        isSetupReady = true;\n      };\n    })();\n  <\/script>\n<\/body>\n<\/html>\n\n","protected":false},"excerpt":{"rendered":"<p>\ubcbd\ub3cc \uae68\uae30 \uac8c\uc784 &#8211; \ubc18\uc751\ud615 \ubc0f \ud130\uce58 \uc9c0\uc6d0 \ubcbd\ub3cc \uae68\uae30 \uac8c\uc784 \uc810\uc218: 0 \ubaa9\uc228: 3 \ub808\ubca8: 1 \uc2dc\uc791 \uc7ac\uc2dc\uc791 \u25c0 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"class_list":["post-635","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/momospace.org\/index.php?rest_route=\/wp\/v2\/pages\/635","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/momospace.org\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/momospace.org\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/momospace.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/momospace.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=635"}],"version-history":[{"count":13,"href":"https:\/\/momospace.org\/index.php?rest_route=\/wp\/v2\/pages\/635\/revisions"}],"predecessor-version":[{"id":815,"href":"https:\/\/momospace.org\/index.php?rest_route=\/wp\/v2\/pages\/635\/revisions\/815"}],"wp:attachment":[{"href":"https:\/\/momospace.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=635"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}