JavaScript19 [테트리스] 2. 벽면 경계 처리, 0.5초간격 떨어지는 블럭 2018. 7. 24. // 캔버스 경계 구하기 var canvas = document.getElementById('game'); const WIDTH = canvas.clientWidth; const HEIGHT = canvas.clientHeight; const CANVAS_LEFT = canvas.clientLeft; const CANVAS_RIGHT = canvas.clientLeft + WIDTH; const CANVAS_TOP = canvas.clientTop; const CANVAS_BOTTOM = canvas.clientTop + HEIGHT; // 5초 간격으로 아래로 움직이는 블럭 setInterval(function(){ nowBlock.drawBlock(nowBlock.x, nowB.. 2019. 8. 27. 이전 1 2 3 4 다음