{"id":503854,"student_id":2589,"content":"","created_at":"2023-03-09T12:27:25.025+08:00","updated_at":"2023-03-09T13:46:12.346+08:00","name":"打磚塊 - 開始後用滑鼠點擊舞台以啟用按鍵,重整畫面即可重新遊戲。","language":"javascript","screenshot":{"url":null},"parent_id":2,"plugin":"setBackdrop(\"#222222\");\nvar player = createSprite(\"player.png\");\nvar ball = createSprite(\"ball.png\");\nvar score = 0;\nvar lives = 3;\nvar speed = 5;\nvar level = 1;\n\nplayer.y = 450;\nball.direction = 180;\n\nvar blocks = [];\nfunction initBlocks () {\n for (var j = 0; j \u003c 6; j++) {\n for (var i = 0; i \u003c 10; i++) {\n var block = createSprite([\"b0.png\", \"b1.png\", \"b2.png\", \"b3.png\", \"b4.png\", \"b5.png\"]);\n block.costumeId = Math.floor(Math.random()*6);\n block.x = i * 64 + 32;\n block.y = j * 32 + 16;\n blocks.push(block);\n }\n }\n}\ninitBlocks();\n\nforever(function () {\n print(\"Score: \" + score, 20, 20, \"white\");\n print(\"Lives: \" + lives, 20, 40, \"white\");\n print(\"Level: \" + level, 20, 60, \"white\");\n\n player.x = cursor.x;\n ball.stepForward(speed);\n ball.bounceEdge();\n\n if (ball.y \u003e= 480) {\n ball.direction = 180;\n ball.x = 320;\n ball.y = 240;\n speed = 5;\n lives--;\n }\n if (lives \u003c= 0) {\n print('Game Over', 170, 200, 'white', 60);\n stop();\n }\n});\n\nball.on('touch', blocks, function (block) {\n ball.direction = -ball.direction + 180 + Math.random() * 20 - 10;\n block.destroy();\n score++;\n if (blocks.length \u003c= 0) {\n initBlocks();\n level++;\n }\n});\n\nball.on('touch', player, function () {\n ball.direction = -ball.direction + 180 + Math.random() * 20 - 10;\n ball.y = player.y - 27;\n if (speed \u003c 5 + level*2) speed += 1;\n});","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":88,"hashid":"2pdsrem49","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":11449253,"file_name":"player.png","project_id":503854,"asset_id":612341,"created_at":"2023-03-09T12:27:35.469+08:00","updated_at":"2023-03-09T12:27:35.469+08:00"},{"id":11449254,"file_name":"ball.png","project_id":503854,"asset_id":612342,"created_at":"2023-03-09T12:27:35.475+08:00","updated_at":"2023-03-09T12:27:35.475+08:00"},{"id":11449255,"file_name":"b0.png","project_id":503854,"asset_id":612343,"created_at":"2023-03-09T12:27:35.479+08:00","updated_at":"2023-03-09T12:27:35.479+08:00"},{"id":11449256,"file_name":"b1.png","project_id":503854,"asset_id":612344,"created_at":"2023-03-09T12:27:35.487+08:00","updated_at":"2023-03-09T12:27:35.487+08:00"},{"id":11449257,"file_name":"b2.png","project_id":503854,"asset_id":612345,"created_at":"2023-03-09T12:27:35.492+08:00","updated_at":"2023-03-09T12:27:35.492+08:00"},{"id":11449258,"file_name":"b3.png","project_id":503854,"asset_id":612346,"created_at":"2023-03-09T12:27:35.501+08:00","updated_at":"2023-03-09T12:27:35.501+08:00"},{"id":11449259,"file_name":"b4.png","project_id":503854,"asset_id":612347,"created_at":"2023-03-09T12:27:35.506+08:00","updated_at":"2023-03-09T12:27:35.506+08:00"},{"id":11449260,"file_name":"b5.png","project_id":503854,"asset_id":612348,"created_at":"2023-03-09T12:27:35.511+08:00","updated_at":"2023-03-09T12:27:35.511+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦