{"id":17769,"student_id":119,"content":"setBackdrop('bg.jpg');\r\nvar clock = 0;\r\nvar balloons = []\r\nvar score = 0;\r\nvar time = \"start\";\r\nvar target = createSprite(\"target.png\");\r\ntarget.scale = 0.6\r\nsetTimeout(function () {\r\n time = \"stop\";\r\n}, 30000)\r\nforever(function () {\r\n target.x = cursor.x\r\n target.y = cursor.y\r\n target.layer = 1\r\n if (clock % 30 == 0 \u0026\u0026 time == \"start\") {\r\n var balloon = createSprite([\"a_1.png\", \"a_5.png\", \"a_10.png\", \"a_50.png\", \"a_100.png\", \"m_2.png\", \"e_2.png\", \"0.png\"]);\r\n if (Math.random() * 100 \u003c 50) {\r\n balloon.costumeId = Math.floor(Math.random() * 4)\r\n } else {\r\n if (Math.random() * 100 \u003c 25) {\r\n balloon.costumeId = 5\r\n } else {\r\n if (Math.random() * 100 \u003c 18) {\r\n balloon.costumeId = Math.floor(Math.random() * 2) * 5\r\n } else { if (Math.random() * 100 \u003c 20) {\r\n balloon.costumeId = 7\r\n }else{balloon.costumeId=0} }\r\n }\r\n }\r\n balloon.x = Math.random() * 640\r\n balloon.y = 500\r\n balloons.push(balloon)\r\n }\r\n for (var i = 0; i \u003c balloons.length; i++) {\r\n if (cursor.isDown \u0026\u0026 balloons[i].touched(cursor)) {\r\n if (balloons[i].costumeId == 0) { score += 1 }\r\n if (balloons[i].costumeId == 1) { score += 5 }\r\n if (balloons[i].costumeId == 2) { score += 10 }\r\n if (balloons[i].costumeId == 3) { score += 50 }\r\n if (balloons[i].costumeId == 4) { score += 100 }\r\n if (balloons[i].costumeId == 5) { score *= 2 }\r\n if (balloons[i].costumeId == 6) { score /= 2 }\r\n if (balloons[i].costumeId == 7) { score = 0 }\r\n balloons[i].destroy();\r\n }\r\n if (balloons[i].costumeId \u003e -1 \u0026\u0026 balloons[i].costumeId \u003c 5) { balloons[i].y -= 3; }\r\n if (balloons[i].costumeId \u003e 4 \u0026\u0026 balloons[i].costumeId \u003c 7) { balloons[i].y -= 5; }\r\n if (balloons[i].costumeId \u003e 6 \u0026\u0026 balloons[i].costumeId \u003c 8) { balloons[i].y -= 2; }\r\n }\r\n print(\"得分:\" + score)\r\n clock += 1;\r\n});","created_at":"2017-03-01T20:52:04.729+08:00","updated_at":"2019-06-04T07:06:02.676+08:00","name":"射氣球","language":"javascript","screenshot":{"url":"https://cdn9.koding.school/uploads/project/screenshot/17769/89edcce60b8890776f43b51e69f48ea4.jpg"},"parent_id":11105,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":75,"hashid":"9ygspwd5","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":362721,"file_name":"bg.jpg","project_id":17769,"asset_id":29311,"created_at":"2017-12-16T10:05:56.454+08:00","updated_at":"2017-12-16T10:05:56.454+08:00"},{"id":362722,"file_name":"target.png","project_id":17769,"asset_id":29312,"created_at":"2017-12-16T10:05:56.456+08:00","updated_at":"2017-12-16T10:05:56.456+08:00"},{"id":362723,"file_name":"0.png","project_id":17769,"asset_id":29313,"created_at":"2017-12-16T10:05:56.458+08:00","updated_at":"2017-12-16T10:05:56.458+08:00"},{"id":362724,"file_name":"a_1.png","project_id":17769,"asset_id":29314,"created_at":"2017-12-16T10:05:56.460+08:00","updated_at":"2017-12-16T10:05:56.460+08:00"},{"id":362725,"file_name":"a_5.png","project_id":17769,"asset_id":29315,"created_at":"2017-12-16T10:05:56.463+08:00","updated_at":"2017-12-16T10:05:56.463+08:00"},{"id":362726,"file_name":"e_2.png","project_id":17769,"asset_id":29316,"created_at":"2017-12-16T10:05:56.465+08:00","updated_at":"2017-12-16T10:05:56.465+08:00"},{"id":362727,"file_name":"m_2.png","project_id":17769,"asset_id":29317,"created_at":"2017-12-16T10:05:56.466+08:00","updated_at":"2017-12-16T10:05:56.466+08:00"},{"id":362728,"file_name":"a_100.png","project_id":17769,"asset_id":29318,"created_at":"2017-12-16T10:05:56.468+08:00","updated_at":"2017-12-16T10:05:56.468+08:00"},{"id":362729,"file_name":"a_50.png","project_id":17769,"asset_id":29319,"created_at":"2017-12-16T10:05:56.469+08:00","updated_at":"2017-12-16T10:05:56.469+08:00"},{"id":362730,"file_name":"a_10.png","project_id":17769,"asset_id":29320,"created_at":"2017-12-16T10:05:56.473+08:00","updated_at":"2017-12-16T10:05:56.473+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦