王鈺嘉VSCode編輯HTML,CSS,JS 俄羅斯方塊
*{ margin: 0; padding: 0; box-sizing: border-box;} body{ display: flex; height: 90vh; align-items: center; justify-content: space-evenly; flex-direction: column; background-color: whitesmoke;} #tetris{ background-color: white; box-shadow: 0 0 10px 2px lightgrey;} h2{background-color: black; color:white; border: solid 5px red; } let canvas = document.getElementById("tetris"); let scoreboard = document.getElementById("score"); let ctx = canvas.getContext("2d"); ctx.scale(30,30); const FOUR = [ //設定 [[0,1,0,0],[0,1,0,0],[0,1,0,0],[0,1,0,0]],//I紅 [[0,1,0], [0,1,0], [1,1,0]], //J橘 [[0,1,0], [0,1,0], [0,1,1]], //L黃 [[1,1,0], [0,1,1], [0,0,0]], //Z綠 [[0,1,1], [1,1,0], [0,0,0]], //S藍 [[1,1,1], [0,1,0], [0,0,0]], //T靛 [[1,1], [1,1],]]; //M紫,正方形,以上共7個 const COLORS = [ "light...