{"id":776866,"student_id":10,"content":"from game import set_backdrop, create_sprite, forever\nfrom random import random, randrange\n\nset_backdrop('bg.png')\nnumbers = ['0.png', '1.png', '2.png', '3.png', '4.png', '5.png', '6.png', '7.png', '8.png', '9.png']\nplayer = create_sprite('p_0.png', 'p_1.png', 'p_2.png', 'p_3.png', 'p_4.png', 'p_5.png')\nballoons = create_sprite('balloons.png')\nrules = create_sprite('rules.png')\nn1 = game.create_sprite(numbers)\nn2 = game.create_sprite(numbers)\nn3 = game.create_sprite(numbers)\nplayer.move_to(1000, 600)\nballoons.move_to(1000, 600)\nn1.move_to(50, 50)\nn2.move_to(125, 50)\nn3.move_to(200, 50)\n\nvisitors = []\n\nfor i in range(5):\n s = create_sprite(\n 'g_0.png', 'g_1.png', 'g_2.png', 'g_3.png',\n 'g_4.png', 'g_5.png', 'g_6.png', 'g_7.png',\n 'g_8.png', 'g_9.png', 'g_10.png', 'g_11.png',\n 'g_12.png', 'g_13.png', 'g_14.png', 'g_15.png'\n )\n s.x = i * 300 - 1200\n s.y = 600\n s.y = random() * 900\n s.costume_id = randrange(4) * 4\n s.turbo = False\n visitors.append(s)\n\nscore = 0\n\ndef loop():\n \n if key.space: rules.hidden = True\n if key.right: player.costume_id = 1\n if key.left: player.costume_id = 2\n \n if rules.hidden and player.costume_id \u003c 3:\n for s in visitors:\n update_position(s)\n update_costume(s)\n exchange_balloon(s)\n \n if player.costume_id \u003e= 3: balloons.y -= 2\n \n update_scores()\n\n\ndef update_position(s):\n \n speed = 3 + score // 10\n s.x += speed\n \n if s.x \u003c 900:\n ratio = (600 - s.y) / (900 - s.x)\n s.y += speed * ratio\n if s.turbo:\n s.x += speed\n s.y += speed * ratio\n else:\n s.y += 5\n \n if s.x \u003e= 1350:\n s.x -= 1500\n s.costume_id = randrange(4) * 4\n s.y = random() * 900\n s.turbo = random() \u003c 0.2\n\n if s.turbo:\n s.x -= s.x - 300\n s.y -= s.y - 900\n\ndef exchange_balloon(s):\n global score\n if s.x \u003e= 900 and s.costume_id % 4 \u003c 2:\n if player.costume_id == 1 and s.costume_id \u003c 8:\n s.costume_id += 2\n player.costume_id = 0\n score += 1\n elif player.costume_id == 2 and s.costume_id \u003e 7:\n s.costume_id += 2\n player.costume_id = 0\n score += 1\n else:\n player.costume_id += 3\n \ndef update_costume(s):\n i = (s.x // 50) % 2\n if s.costume_id % 2 == 0 and i == 1: s.costume_id += 1\n if s.costume_id % 2 == 1 and i == 0: s.costume_id -= 1\n\ndef update_scores():\n n1.costume_id = (score // 100) % 10\n n2.costume_id = (score // 10) % 10\n n3.costume_id = (score // 1) % 10\n \nforever(loop)\n","created_at":"2024-06-26T16:49:14.644+08:00","updated_at":"2024-06-26T16:53:10.355+08:00","name":"發送氣球 水平翻轉版","language":"python","screenshot":{"url":"https://cdn3.koding.school/uploads/project/screenshot/776866/1b191f5603838dd6605f6938deab34ba.jpg"},"parent_id":776559,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":39,"hashid":"d5msnmdz4","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":17314341,"file_name":"g_8.png","project_id":776866,"asset_id":750621,"created_at":"2024-06-26T16:50:00.820+08:00","updated_at":"2024-06-26T16:50:00.820+08:00"},{"id":17314342,"file_name":"g_9.png","project_id":776866,"asset_id":750622,"created_at":"2024-06-26T16:50:00.822+08:00","updated_at":"2024-06-26T16:50:00.822+08:00"},{"id":17314351,"file_name":"p_2.png","project_id":776866,"asset_id":750631,"created_at":"2024-06-26T16:50:02.570+08:00","updated_at":"2024-06-26T16:50:02.570+08:00"},{"id":17314352,"file_name":"p_3.png","project_id":776866,"asset_id":750632,"created_at":"2024-06-26T16:50:02.571+08:00","updated_at":"2024-06-26T16:50:02.571+08:00"},{"id":17314353,"file_name":"p_4.png","project_id":776866,"asset_id":750633,"created_at":"2024-06-26T16:50:02.971+08:00","updated_at":"2024-06-26T16:50:02.971+08:00"},{"id":17314354,"file_name":"p_5.png","project_id":776866,"asset_id":750634,"created_at":"2024-06-26T16:50:02.973+08:00","updated_at":"2024-06-26T16:50:02.973+08:00"},{"id":17314337,"file_name":"g_4.png","project_id":776866,"asset_id":750617,"created_at":"2024-06-26T16:50:00.090+08:00","updated_at":"2024-06-26T16:50:00.090+08:00"},{"id":17314338,"file_name":"g_5.png","project_id":776866,"asset_id":750618,"created_at":"2024-06-26T16:50:00.091+08:00","updated_at":"2024-06-26T16:50:00.091+08:00"},{"id":17314331,"file_name":"balloons.png","project_id":776866,"asset_id":750611,"created_at":"2024-06-26T16:49:58.572+08:00","updated_at":"2024-06-26T16:49:58.572+08:00"},{"id":17314332,"file_name":"bg.png","project_id":776866,"asset_id":750612,"created_at":"2024-06-26T16:49:58.573+08:00","updated_at":"2024-06-26T16:49:58.573+08:00"},{"id":17314349,"file_name":"p_0.png","project_id":776866,"asset_id":750629,"created_at":"2024-06-26T16:50:02.202+08:00","updated_at":"2024-06-26T16:50:02.202+08:00"},{"id":17314350,"file_name":"p_1.png","project_id":776866,"asset_id":750630,"created_at":"2024-06-26T16:50:02.203+08:00","updated_at":"2024-06-26T16:50:02.203+08:00"},{"id":17314335,"file_name":"g_2.png","project_id":776866,"asset_id":750615,"created_at":"2024-06-26T16:49:59.451+08:00","updated_at":"2024-06-26T16:49:59.451+08:00"},{"id":17314336,"file_name":"g_3.png","project_id":776866,"asset_id":750616,"created_at":"2024-06-26T16:49:59.452+08:00","updated_at":"2024-06-26T16:49:59.452+08:00"},{"id":17314333,"file_name":"g_0.png","project_id":776866,"asset_id":750613,"created_at":"2024-06-26T16:49:59.014+08:00","updated_at":"2024-06-26T16:49:59.014+08:00"},{"id":17314334,"file_name":"g_1.png","project_id":776866,"asset_id":750614,"created_at":"2024-06-26T16:49:59.016+08:00","updated_at":"2024-06-26T16:49:59.016+08:00"},{"id":17314339,"file_name":"g_6.png","project_id":776866,"asset_id":750619,"created_at":"2024-06-26T16:50:00.498+08:00","updated_at":"2024-06-26T16:50:00.498+08:00"},{"id":17314340,"file_name":"g_7.png","project_id":776866,"asset_id":750620,"created_at":"2024-06-26T16:50:00.499+08:00","updated_at":"2024-06-26T16:50:00.499+08:00"},{"id":17314343,"file_name":"g_10.png","project_id":776866,"asset_id":750623,"created_at":"2024-06-26T16:50:01.250+08:00","updated_at":"2024-06-26T16:50:01.250+08:00"},{"id":17314344,"file_name":"g_11.png","project_id":776866,"asset_id":750624,"created_at":"2024-06-26T16:50:01.252+08:00","updated_at":"2024-06-26T16:50:01.252+08:00"},{"id":17314345,"file_name":"g_12.png","project_id":776866,"asset_id":750625,"created_at":"2024-06-26T16:50:01.580+08:00","updated_at":"2024-06-26T16:50:01.580+08:00"},{"id":17314346,"file_name":"g_13.png","project_id":776866,"asset_id":750626,"created_at":"2024-06-26T16:50:01.582+08:00","updated_at":"2024-06-26T16:50:01.582+08:00"},{"id":17314297,"file_name":"4.png","project_id":776866,"asset_id":750586,"created_at":"2024-06-26T16:49:14.653+08:00","updated_at":"2024-06-26T16:49:14.653+08:00"},{"id":17314298,"file_name":"5.png","project_id":776866,"asset_id":750587,"created_at":"2024-06-26T16:49:14.654+08:00","updated_at":"2024-06-26T16:49:14.654+08:00"},{"id":17314303,"file_name":"2.png","project_id":776866,"asset_id":750584,"created_at":"2024-06-26T16:49:14.659+08:00","updated_at":"2024-06-26T16:49:14.659+08:00"},{"id":17314304,"file_name":"3.png","project_id":776866,"asset_id":750585,"created_at":"2024-06-26T16:49:14.660+08:00","updated_at":"2024-06-26T16:49:14.660+08:00"},{"id":17314313,"file_name":"0.png","project_id":776866,"asset_id":750582,"created_at":"2024-06-26T16:49:14.668+08:00","updated_at":"2024-06-26T16:49:14.668+08:00"},{"id":17314314,"file_name":"1.png","project_id":776866,"asset_id":750583,"created_at":"2024-06-26T16:49:14.669+08:00","updated_at":"2024-06-26T16:49:14.669+08:00"},{"id":17314319,"file_name":"8.png","project_id":776866,"asset_id":750590,"created_at":"2024-06-26T16:49:14.673+08:00","updated_at":"2024-06-26T16:49:14.673+08:00"},{"id":17314320,"file_name":"9.png","project_id":776866,"asset_id":750591,"created_at":"2024-06-26T16:49:14.674+08:00","updated_at":"2024-06-26T16:49:14.674+08:00"},{"id":17314328,"file_name":"rules.png","project_id":776866,"asset_id":750610,"created_at":"2024-06-26T16:49:14.681+08:00","updated_at":"2024-06-26T16:49:14.681+08:00"},{"id":17314329,"file_name":"6.png","project_id":776866,"asset_id":750588,"created_at":"2024-06-26T16:49:14.682+08:00","updated_at":"2024-06-26T16:49:14.682+08:00"},{"id":17314330,"file_name":"7.png","project_id":776866,"asset_id":750589,"created_at":"2024-06-26T16:49:14.683+08:00","updated_at":"2024-06-26T16:49:14.683+08:00"},{"id":17314347,"file_name":"g_14.png","project_id":776866,"asset_id":750627,"created_at":"2024-06-26T16:50:01.887+08:00","updated_at":"2024-06-26T16:50:01.887+08:00"},{"id":17314348,"file_name":"g_15.png","project_id":776866,"asset_id":750628,"created_at":"2024-06-26T16:50:01.888+08:00","updated_at":"2024-06-26T16:50:01.888+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦