{"id":183176,"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-20T10:41:04.564+08:00","updated_at":"2022-11-02T15:13:26.966+08:00","name":"氣球樂園(DT試玩版) 副本 副本","language":"javascript","screenshot":{"url":"https://cdn1.koding.school/uploads/project/screenshot/183176/1232439824b101d0ae8169cef1411b19.jpg"},"parent_id":183019,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":232,"hashid":"jzmsg8nm","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":3115372,"file_name":"bg.jpg","project_id":183176,"asset_id":127572,"created_at":"2020-08-20T10:41:04.569+08:00","updated_at":"2020-08-20T10:41:04.569+08:00"},{"id":3115373,"file_name":"target.png","project_id":183176,"asset_id":127573,"created_at":"2020-08-20T10:41:04.570+08:00","updated_at":"2020-08-20T10:41:04.570+08:00"},{"id":3115374,"file_name":"0.png","project_id":183176,"asset_id":127574,"created_at":"2020-08-20T10:41:04.572+08:00","updated_at":"2020-08-20T10:41:04.572+08:00"},{"id":3115375,"file_name":"a_1.png","project_id":183176,"asset_id":127575,"created_at":"2020-08-20T10:41:04.573+08:00","updated_at":"2020-08-20T10:41:04.573+08:00"},{"id":3115376,"file_name":"a_5.png","project_id":183176,"asset_id":127576,"created_at":"2020-08-20T10:41:04.574+08:00","updated_at":"2020-08-20T10:41:04.574+08:00"},{"id":3115377,"file_name":"e_2.png","project_id":183176,"asset_id":127577,"created_at":"2020-08-20T10:41:04.575+08:00","updated_at":"2020-08-20T10:41:04.575+08:00"},{"id":3115378,"file_name":"m_2.png","project_id":183176,"asset_id":127578,"created_at":"2020-08-20T10:41:04.576+08:00","updated_at":"2020-08-20T10:41:04.576+08:00"},{"id":3115379,"file_name":"a_100.png","project_id":183176,"asset_id":127579,"created_at":"2020-08-20T10:41:04.577+08:00","updated_at":"2020-08-20T10:41:04.577+08:00"},{"id":3115380,"file_name":"a_50.png","project_id":183176,"asset_id":127580,"created_at":"2020-08-20T10:41:04.578+08:00","updated_at":"2020-08-20T10:41:04.578+08:00"},{"id":3115381,"file_name":"a_10.png","project_id":183176,"asset_id":127581,"created_at":"2020-08-20T10:41:04.579+08:00","updated_at":"2020-08-20T10:41:04.579+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦