{"id":162849,"student_id":2589,"content":"import game\nimport random\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')\ngame.create_sound('bgm.mp3')\n\nnumber.opacity = 0.7\nbg_1.layer = 1\nnumber.layer = 2\ntarget.layer = 3\nreward.layer = 4\nreward.hidden = True\nnumber.hidden = True\n\nclock = 0\nscores = 0\nballoons = []\nendTime = time.time() + 10\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.randint(0, 6)\n if rand == 0:\n b.costume_id = 0\n elif rand == 1:\n b.costume_id = 1\n elif rand == 2:\n b.costume_id = 2\n elif rand == 3:\n b.costume_id = 3\n elif rand == 4:\n b.costume_id = 4\n elif rand == 5:\n b.costume_id = 5\n else:\n b.costume_id = 6\n b.y = 1000\n b.x = random.random()*1000 + 100\n balloons.append(b)\n \n for b in balloons:\n if b.costume_id == 0:\n b.y -= 3\n if b.costume_id == 1:\n b.y -= 5\n if b.costume_id == 2:\n b.y -= 7\n if b.costume_id == 3:\n b.y -= 8\n if b.costume_id == 4:\n b.y -= 8\n if b.costume_id == 5:\n b.y -= 7\n if b.costume_id == 6:\n b.y -= 6\n\n if cursor.is_down and b.touched(cursor):\n if b.costume_id == 0:\n scores += 1 \n if b.costume_id == 1:\n scores += 10 \n if b.costume_id == 2:\n scores += 5 \n if b.costume_id == 3:\n scores *= 2 \n if b.costume_id == 4:\n scores /= 2 \n if b.costume_id == 5:\n endTime += 3\n if b.costume_id == 6:\n endTime = time.time() \n b.destroy()\n \n game.create_sound('shot.mp3')\n \n game.draw_text(scores, 60, 20, 'white', 40)\n\n t = endTime - time.time()\n if t \u003c= 5:\n number.hidden = False\n else:\n number.hidden = True\n if t \u003c= 0:\n number.costume_id = 0\n elif t \u003c= 1:\n number.costume_id = 1\n elif t \u003c= 2:\n number.costume_id = 2\n elif t \u003c= 3:\n number.costume_id = 3\n elif t \u003c= 4:\n number.costume_id = 4\n elif t \u003c= 5:\n number.costume_id = 5\n \n if t \u003c= 0:\n reward.hidden = False\n if scores \u003e 10000000000:\n reward.costume_id = 0\n elif scores \u003e 1000000000:\n reward.costume_id = 1\n elif scores \u003e 100000000:\n reward.costume_id = 2\n elif scores \u003e 10000000:\n reward.costume_id = 3\n elif scores \u003e 1000000:\n reward.costume_id = 4\n elif scores \u003e 100000:\n reward.costume_id = 5\n elif scores \u003e 10000:\n reward.costume_id = 6\n elif scores \u003e 1000:\n reward.costume_id = 7\n elif scores \u003e 100:\n reward.costume_id = 8\n elif scores \u003e 10:\n reward.costume_id = 9\n else:\n reward.costume_id = 10\n game.stop()\n \ngame.forever(loop)","created_at":"2020-07-06T01:19:47.349+08:00","updated_at":"2020-07-11T19:17:33.595+08:00","name":"射擊氣球_T ","language":"python","screenshot":{"url":"https://cdn2.koding.school/uploads/project/screenshot/162849/12d9431567931c6b82aa01bccc6d3bcd.jpg"},"parent_id":160697,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":315,"hashid":"6rps46dg","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":2832615,"file_name":"a.png","project_id":162849,"asset_id":199819,"created_at":"2020-07-06T01:19:47.355+08:00","updated_at":"2020-07-06T01:19:47.355+08:00"},{"id":2832616,"file_name":"b.png","project_id":162849,"asset_id":198394,"created_at":"2020-07-06T01:19:47.357+08:00","updated_at":"2020-07-06T01:19:47.357+08:00"},{"id":2832617,"file_name":"bg_1.png","project_id":162849,"asset_id":199814,"created_at":"2020-07-06T01:19:47.358+08:00","updated_at":"2020-07-06T01:19:47.358+08:00"},{"id":2832618,"file_name":"bg_2.png","project_id":162849,"asset_id":199815,"created_at":"2020-07-06T01:19:47.359+08:00","updated_at":"2020-07-06T01:19:47.359+08:00"},{"id":2832619,"file_name":"bgm.mp3","project_id":162849,"asset_id":113696,"created_at":"2020-07-06T01:19:47.360+08:00","updated_at":"2020-07-06T01:19:47.360+08:00"},{"id":2832620,"file_name":"c.png","project_id":162849,"asset_id":198397,"created_at":"2020-07-06T01:19:47.360+08:00","updated_at":"2020-07-06T01:19:47.360+08:00"},{"id":2832621,"file_name":"circle.png","project_id":162849,"asset_id":198061,"created_at":"2020-07-06T01:19:47.361+08:00","updated_at":"2020-07-06T01:19:47.361+08:00"},{"id":2832622,"file_name":"d.png","project_id":162849,"asset_id":199816,"created_at":"2020-07-06T01:19:47.362+08:00","updated_at":"2020-07-06T01:19:47.362+08:00"},{"id":2832623,"file_name":"e.png","project_id":162849,"asset_id":199817,"created_at":"2020-07-06T01:19:47.363+08:00","updated_at":"2020-07-06T01:19:47.363+08:00"},{"id":2832624,"file_name":"f.png","project_id":162849,"asset_id":199818,"created_at":"2020-07-06T01:19:47.364+08:00","updated_at":"2020-07-06T01:19:47.364+08:00"},{"id":2832625,"file_name":"g.png","project_id":162849,"asset_id":199810,"created_at":"2020-07-06T01:19:47.365+08:00","updated_at":"2020-07-06T01:19:47.365+08:00"},{"id":2832626,"file_name":"n0.png","project_id":162849,"asset_id":199872,"created_at":"2020-07-06T01:19:47.366+08:00","updated_at":"2020-07-06T01:19:47.366+08:00"},{"id":2832627,"file_name":"n1.png","project_id":162849,"asset_id":199873,"created_at":"2020-07-06T01:19:47.367+08:00","updated_at":"2020-07-06T01:19:47.367+08:00"},{"id":2832628,"file_name":"n2.png","project_id":162849,"asset_id":199874,"created_at":"2020-07-06T01:19:47.368+08:00","updated_at":"2020-07-06T01:19:47.368+08:00"},{"id":2832629,"file_name":"n3.png","project_id":162849,"asset_id":199875,"created_at":"2020-07-06T01:19:47.369+08:00","updated_at":"2020-07-06T01:19:47.369+08:00"},{"id":2832630,"file_name":"n4.png","project_id":162849,"asset_id":199876,"created_at":"2020-07-06T01:19:47.370+08:00","updated_at":"2020-07-06T01:19:47.370+08:00"},{"id":2832631,"file_name":"n5.png","project_id":162849,"asset_id":199877,"created_at":"2020-07-06T01:19:47.371+08:00","updated_at":"2020-07-06T01:19:47.371+08:00"},{"id":2832632,"file_name":"pointer.png","project_id":162849,"asset_id":198063,"created_at":"2020-07-06T01:19:47.372+08:00","updated_at":"2020-07-06T01:19:47.372+08:00"},{"id":2832633,"file_name":"r0.png","project_id":162849,"asset_id":199857,"created_at":"2020-07-06T01:19:47.373+08:00","updated_at":"2020-07-06T01:19:47.373+08:00"},{"id":2832634,"file_name":"r1.png","project_id":162849,"asset_id":199858,"created_at":"2020-07-06T01:19:47.374+08:00","updated_at":"2020-07-06T01:19:47.374+08:00"},{"id":2832635,"file_name":"r2.png","project_id":162849,"asset_id":199859,"created_at":"2020-07-06T01:19:47.375+08:00","updated_at":"2020-07-06T01:19:47.375+08:00"},{"id":2832636,"file_name":"r3.png","project_id":162849,"asset_id":199860,"created_at":"2020-07-06T01:19:47.376+08:00","updated_at":"2020-07-06T01:19:47.376+08:00"},{"id":2832637,"file_name":"r4.png","project_id":162849,"asset_id":199861,"created_at":"2020-07-06T01:19:47.377+08:00","updated_at":"2020-07-06T01:19:47.377+08:00"},{"id":2832638,"file_name":"r5.png","project_id":162849,"asset_id":199862,"created_at":"2020-07-06T01:19:47.378+08:00","updated_at":"2020-07-06T01:19:47.378+08:00"},{"id":2832639,"file_name":"r6.png","project_id":162849,"asset_id":199863,"created_at":"2020-07-06T01:19:47.379+08:00","updated_at":"2020-07-06T01:19:47.379+08:00"},{"id":2832640,"file_name":"r7.png","project_id":162849,"asset_id":199864,"created_at":"2020-07-06T01:19:47.380+08:00","updated_at":"2020-07-06T01:19:47.380+08:00"},{"id":2832641,"file_name":"r8.png","project_id":162849,"asset_id":199865,"created_at":"2020-07-06T01:19:47.381+08:00","updated_at":"2020-07-06T01:19:47.381+08:00"},{"id":2832642,"file_name":"r9.png","project_id":162849,"asset_id":199866,"created_at":"2020-07-06T01:19:47.382+08:00","updated_at":"2020-07-06T01:19:47.382+08:00"},{"id":2832643,"file_name":"r10.png","project_id":162849,"asset_id":199879,"created_at":"2020-07-06T01:19:47.383+08:00","updated_at":"2020-07-06T01:19:47.383+08:00"},{"id":2832644,"file_name":"shot.mp3","project_id":162849,"asset_id":172349,"created_at":"2020-07-06T01:19:47.384+08:00","updated_at":"2020-07-06T01:19:47.384+08:00"},{"id":2832645,"file_name":"target.png","project_id":162849,"asset_id":199868,"created_at":"2020-07-06T01:19:47.385+08:00","updated_at":"2020-07-06T01:19:47.385+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦