{"id":183019,"student_id":10,"content":"/**\n* 情境:老師為什麼我的氣球都是同樣的圖片...\n* 提示:設定氣球造型編號時有錯誤\n*/\n\nsetBackdrop('bg.jpg');\nvar target = createSprite('target.png');\ntarget.layer = 1;\n\nvar balloons = [];\nvar clock = 0;\nvar scores = 0;\nvar status = 'start';\n\nforever(function() {\n\n //準星跟著滑鼠移動\n target.x = cursor.x;\n target.y = cursor.y;\n\n clock++;\n \n //每執行 15 次迴圈就創造一個氣球\n if (clock%15 == 0 \u0026\u0026 status != 'stop') {\n var balloon = createSprite(['0.png', 'a_1.png', 'a_5.png', 'a_10.png', 'a_50.png', 'a_100.png', 'm_2.png', 'e_2.png']);\n var rand = Math.random();\n\n //根據機率設定氣球的造型\n if (rand \u003c 0.1) {\n balloon.costumeid = 0;\n } else if (rand \u003c 0.3) {\n balloon.costumeid = 1;\n } else if (rand \u003c 0.5) {\n balloon.costumeid = 2;\n } else if (rand \u003c 0.7) {\n balloon.costumeid = 3;\n } else if (rand \u003c 0.8) {\n balloon.costumeid = 4;\n } else if (rand \u003c 0.85) {\n balloon.costumeid = 5;\n } else if (rand \u003c 0.9) {\n balloon.costumeid = 6;\n } else {\n balloon.costumeid = 7;\n }\n \n balloon.y = 500;\n balloon.x = Math.random()*640;\n balloons.push(balloon);\n }\n \n //將氣球從陣列中逐一取出並移動\n for (var i = 0; i \u003c balloons.length; i++) {\n balloons[i].y -= 3;\n }\n\n print(\"得分:\" + scores, 10, 10, 'red', 20);\n});","created_at":"2020-08-19T16:47:21.697+08:00","updated_at":"2022-11-02T15:12:43.722+08:00","name":"氣球樂園(DT試玩版) 副本","language":"javascript","screenshot":{"url":"https://cdn3.koding.school/uploads/project/screenshot/183019/22fb64fed15422fa08b63593d32843c8.jpg"},"parent_id":73439,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":240,"hashid":"4y3s4md3","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":3112978,"file_name":"a_10.png","project_id":183019,"asset_id":127581,"created_at":"2020-08-19T16:47:21.703+08:00","updated_at":"2020-08-19T16:47:21.703+08:00"},{"id":3112979,"file_name":"a_50.png","project_id":183019,"asset_id":127580,"created_at":"2020-08-19T16:47:21.705+08:00","updated_at":"2020-08-19T16:47:21.705+08:00"},{"id":3112980,"file_name":"a_100.png","project_id":183019,"asset_id":127579,"created_at":"2020-08-19T16:47:21.706+08:00","updated_at":"2020-08-19T16:47:21.706+08:00"},{"id":3112981,"file_name":"m_2.png","project_id":183019,"asset_id":127578,"created_at":"2020-08-19T16:47:21.707+08:00","updated_at":"2020-08-19T16:47:21.707+08:00"},{"id":3112982,"file_name":"e_2.png","project_id":183019,"asset_id":127577,"created_at":"2020-08-19T16:47:21.708+08:00","updated_at":"2020-08-19T16:47:21.708+08:00"},{"id":3112983,"file_name":"a_5.png","project_id":183019,"asset_id":127576,"created_at":"2020-08-19T16:47:21.709+08:00","updated_at":"2020-08-19T16:47:21.709+08:00"},{"id":3112984,"file_name":"a_1.png","project_id":183019,"asset_id":127575,"created_at":"2020-08-19T16:47:21.710+08:00","updated_at":"2020-08-19T16:47:21.710+08:00"},{"id":3112985,"file_name":"0.png","project_id":183019,"asset_id":127574,"created_at":"2020-08-19T16:47:21.711+08:00","updated_at":"2020-08-19T16:47:21.711+08:00"},{"id":3112986,"file_name":"target.png","project_id":183019,"asset_id":127573,"created_at":"2020-08-19T16:47:21.712+08:00","updated_at":"2020-08-19T16:47:21.712+08:00"},{"id":3112987,"file_name":"bg.jpg","project_id":183019,"asset_id":127572,"created_at":"2020-08-19T16:47:21.713+08:00","updated_at":"2020-08-19T16:47:21.713+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦