<iframe width="560" height="315" src="https://www.youtube.com/embed/G0nQ-E2TKEY?si=C4SjIZG7o9tEXA-x" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
郭宇林VS Code俄羅斯方塊maintain維護物件object
js程式碼 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 = [ "lightgray","red","orange","yellow","darkgreen","blue","indigo","purple"]; const ROWS = 20; //列數ROWS const COLS = 10; //欄數COLumnS let grid = generateGrid(); //呼叫函數產生20x10格子 let fallingPieceObj = null; let score = 0; setInterval(newGameState,200); //...
911錯誤,要在html模式才對.https://rainhtmlcssjavascriptjavapython.blogspot.com/2023/09/width560-height315-srchttpswww.html
回覆刪除