{"id":163402,"student_id":10,"content":"import game\nimport math\nimport random\nimport datetime\nimport time\n\nbg_1 = game.create_sprite('bg_1.png')\nbg_2 = game.create_sprite('bg_2.png')\ntarget = game.create_sprite('target.png')\nreward = game.create_sprite('r0.png','r1.png','r2.png','r3.png','r4.png','r5.png','r6.png','r7.png','r8.png','r9.png','r10.png')\nnumber = game.create_sprite('n0.png','n1.png','n2.png','n3.png','n4.png','n5.png')\nendTime = time.time() + 15000\nclock = 0\nscores = 0\nballoons = []\n\nnumber.opacity = 0.7\n\nbg_1.layer = 1\nnumber.layer = 2\ntarget.layer = 3\nreward.layer = 4\nreward.hidden = True\n\ntarget.scale = 0.75\n\ncreateSound('bgm.mp3')\n\ndef loop ():\n global clock, scores, endTime\n \n target.x = cursor.x\n target.y = cursor.y\n\n clock += 1\n if clock%10 == 0:\n b = game.create_sprite('a.png', 'b.png', 'c.png', 'd.png', 'e.png', 'g.png', 'f.png')\n rand = random.random()\n if rand \u003c 0.3: b.costume_id = 0\n elif rand \u003c 0.6: b.costume_id = 1\n elif rand \u003c 0.7: b.costume_id = 2\n elif rand \u003c 0.8: b.costume_id = 3\n elif rand \u003c 0.9: b.costume_id = 4\n elif rand \u003c 0.95: b.costume_id = 5\n else: b.costume_id = 6\n b.y = 1000\n b.x = random.random()*1000 + 100\n balloons.append(b)\n \n\n for b in balloons:\n if b.costume_id == 0: b.y -= 3\n if b.costume_id == 1: b.y -= 5\n if b.costume_id == 2: b.y -= 7\n if b.costume_id == 3: b.y -= 8\n if b.costume_id == 4: b.y -= 8\n if b.costume_id == 5: b.y -= 7\n if b.costume_id == 6: b.y -= 6\n\n if cursor.isDown and b.touched(cursor):\n if b.costume_id == 0: scores += 1 \n if b.costume_id == 1: scores += 10 \n if b.costume_id == 2: scores += 5 \n if b.costume_id == 3: scores *= 2 \n if b.costume_id == 4: scores /= 2 \n if b.costume_id == 5: endTime += 3000 \n if b.costume_id == 6: endTime = time.time() \n b.destroy()\n scores = math.floor(scores)\n sound.play('shot.mp3')\n \n drawText(scores, 60, 20, 'white', 40)\n\n t = math.floor((endTime - time.time())/1000)\n\n number.hidden = t \u003e 5\n if t == 5: number.costume_id = 5\n if t == 4: number.costume_id = 4\n if t == 3: number.costume_id = 3\n if t == 2: number.costume_id = 2\n if t == 1: number.costume_id = 1\n if t == 0: number.costume_id = 0\n \n if t \u003c 0:\n reward.hidden = False\n if scores \u003e 10000000000: reward.costume_id = 0\n elif scores \u003e 1000000000: reward.costume_id = 1\n elif scores \u003e 100000000: reward.costume_id = 2\n elif scores \u003e 10000000: reward.costume_id = 3\n elif scores \u003e 1000000: reward.costume_id = 4\n elif scores \u003e 100000: reward.costume_id = 5\n elif scores \u003e 10000: reward.costume_id = 6\n elif scores \u003e 1000: reward.costume_id = 7\n elif scores \u003e 100: reward.costume_id = 8\n elif scores \u003e 10: reward.costume_id = 9\n else: reward.costume_id = 10\n stop()\n \ngame.forever(loop)","created_at":"2020-07-10T10:38:19.635+08:00","updated_at":"2020-07-10T10:39:10.766+08:00","name":"射擊氣球 副本","language":"python","screenshot":{"url":"https://cdn9.koding.school/uploads/project/screenshot/163402/3ad0fbe78fd4c4b4ed9f41dc7abadfc2.jpg"},"parent_id":150223,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":252,"hashid":"rdvsw5j6","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":2837721,"file_name":"target.png","project_id":163402,"asset_id":199868,"created_at":"2020-07-10T10:38:19.641+08:00","updated_at":"2020-07-10T10:38:19.641+08:00"},{"id":2837722,"file_name":"shot.mp3","project_id":163402,"asset_id":172349,"created_at":"2020-07-10T10:38:19.643+08:00","updated_at":"2020-07-10T10:38:19.643+08:00"},{"id":2837723,"file_name":"r10.png","project_id":163402,"asset_id":199879,"created_at":"2020-07-10T10:38:19.644+08:00","updated_at":"2020-07-10T10:38:19.644+08:00"},{"id":2837724,"file_name":"r9.png","project_id":163402,"asset_id":199866,"created_at":"2020-07-10T10:38:19.645+08:00","updated_at":"2020-07-10T10:38:19.645+08:00"},{"id":2837725,"file_name":"r8.png","project_id":163402,"asset_id":199865,"created_at":"2020-07-10T10:38:19.646+08:00","updated_at":"2020-07-10T10:38:19.646+08:00"},{"id":2837726,"file_name":"r7.png","project_id":163402,"asset_id":199864,"created_at":"2020-07-10T10:38:19.647+08:00","updated_at":"2020-07-10T10:38:19.647+08:00"},{"id":2837727,"file_name":"r6.png","project_id":163402,"asset_id":199863,"created_at":"2020-07-10T10:38:19.648+08:00","updated_at":"2020-07-10T10:38:19.648+08:00"},{"id":2837728,"file_name":"r5.png","project_id":163402,"asset_id":199862,"created_at":"2020-07-10T10:38:19.648+08:00","updated_at":"2020-07-10T10:38:19.648+08:00"},{"id":2837729,"file_name":"r4.png","project_id":163402,"asset_id":199861,"created_at":"2020-07-10T10:38:19.649+08:00","updated_at":"2020-07-10T10:38:19.649+08:00"},{"id":2837730,"file_name":"r3.png","project_id":163402,"asset_id":199860,"created_at":"2020-07-10T10:38:19.650+08:00","updated_at":"2020-07-10T10:38:19.650+08:00"},{"id":2837731,"file_name":"r2.png","project_id":163402,"asset_id":199859,"created_at":"2020-07-10T10:38:19.651+08:00","updated_at":"2020-07-10T10:38:19.651+08:00"},{"id":2837732,"file_name":"r1.png","project_id":163402,"asset_id":199858,"created_at":"2020-07-10T10:38:19.652+08:00","updated_at":"2020-07-10T10:38:19.652+08:00"},{"id":2837733,"file_name":"r0.png","project_id":163402,"asset_id":199857,"created_at":"2020-07-10T10:38:19.653+08:00","updated_at":"2020-07-10T10:38:19.653+08:00"},{"id":2837734,"file_name":"pointer.png","project_id":163402,"asset_id":198063,"created_at":"2020-07-10T10:38:19.654+08:00","updated_at":"2020-07-10T10:38:19.654+08:00"},{"id":2837735,"file_name":"n5.png","project_id":163402,"asset_id":199877,"created_at":"2020-07-10T10:38:19.655+08:00","updated_at":"2020-07-10T10:38:19.655+08:00"},{"id":2837736,"file_name":"n4.png","project_id":163402,"asset_id":199876,"created_at":"2020-07-10T10:38:19.656+08:00","updated_at":"2020-07-10T10:38:19.656+08:00"},{"id":2837737,"file_name":"n3.png","project_id":163402,"asset_id":199875,"created_at":"2020-07-10T10:38:19.657+08:00","updated_at":"2020-07-10T10:38:19.657+08:00"},{"id":2837738,"file_name":"n2.png","project_id":163402,"asset_id":199874,"created_at":"2020-07-10T10:38:19.658+08:00","updated_at":"2020-07-10T10:38:19.658+08:00"},{"id":2837739,"file_name":"n1.png","project_id":163402,"asset_id":199873,"created_at":"2020-07-10T10:38:19.659+08:00","updated_at":"2020-07-10T10:38:19.659+08:00"},{"id":2837740,"file_name":"n0.png","project_id":163402,"asset_id":199872,"created_at":"2020-07-10T10:38:19.660+08:00","updated_at":"2020-07-10T10:38:19.660+08:00"},{"id":2837741,"file_name":"g.png","project_id":163402,"asset_id":199810,"created_at":"2020-07-10T10:38:19.660+08:00","updated_at":"2020-07-10T10:38:19.660+08:00"},{"id":2837742,"file_name":"f.png","project_id":163402,"asset_id":199818,"created_at":"2020-07-10T10:38:19.661+08:00","updated_at":"2020-07-10T10:38:19.661+08:00"},{"id":2837743,"file_name":"e.png","project_id":163402,"asset_id":199817,"created_at":"2020-07-10T10:38:19.662+08:00","updated_at":"2020-07-10T10:38:19.662+08:00"},{"id":2837744,"file_name":"d.png","project_id":163402,"asset_id":199816,"created_at":"2020-07-10T10:38:19.663+08:00","updated_at":"2020-07-10T10:38:19.663+08:00"},{"id":2837745,"file_name":"circle.png","project_id":163402,"asset_id":198061,"created_at":"2020-07-10T10:38:19.664+08:00","updated_at":"2020-07-10T10:38:19.664+08:00"},{"id":2837746,"file_name":"c.png","project_id":163402,"asset_id":198397,"created_at":"2020-07-10T10:38:19.665+08:00","updated_at":"2020-07-10T10:38:19.665+08:00"},{"id":2837747,"file_name":"bgm.mp3","project_id":163402,"asset_id":113696,"created_at":"2020-07-10T10:38:19.666+08:00","updated_at":"2020-07-10T10:38:19.666+08:00"},{"id":2837748,"file_name":"bg_2.png","project_id":163402,"asset_id":199815,"created_at":"2020-07-10T10:38:19.667+08:00","updated_at":"2020-07-10T10:38:19.667+08:00"},{"id":2837749,"file_name":"bg_1.png","project_id":163402,"asset_id":199814,"created_at":"2020-07-10T10:38:19.668+08:00","updated_at":"2020-07-10T10:38:19.668+08:00"},{"id":2837750,"file_name":"b.png","project_id":163402,"asset_id":198394,"created_at":"2020-07-10T10:38:19.669+08:00","updated_at":"2020-07-10T10:38:19.669+08:00"},{"id":2837751,"file_name":"a.png","project_id":163402,"asset_id":199819,"created_at":"2020-07-10T10:38:19.670+08:00","updated_at":"2020-07-10T10:38:19.670+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦