{"id":765665,"student_id":10,"content":"from game import *\nfrom random import *\n\nset_backdrop('bg.png')\nitems = []\nspeed = 0\nstatus = 0\n\ni = 0\nwhile i \u003c 11:\n g = create_sprite('g_0.png', 'g_1.png')\n g.x = 600 - 1200 * i\n items.append(g)\n s = create_sprite(str(i) + '.png')\n s.x = 600 - 12000 + i * 500\n items.append(s)\n i += 1\n\n# i = 0\n# while i \u003c 30:\n# t = create_sprite('tree.png')\n# t.y = 540 + 40\n# t.x = 600 - 12000 * random()\n# t.scale = random() * 0.5 + 0.5\n# if t.scale \u003c 0.8: t.layer = -1\n# items.append(t)\n# i += 1\n \nitems[10].costume_id = 1\nexpose = create_sprite('expose.png')\nexpose.y += 150\nplayer = create_sprite('k_0.png', 'k_1.png', 'k_2.png')\nplayer.scale = 0.5\nreset_btn = create_sprite('r_hint.png')\nhint = create_sprite('hint_space.png')\nreset_btn.hidden = True\n\ndef loop():\n global speed, status\n \n score = (player.x - items[10].x) * 10 / 500\n draw_text('成績:' + str(score) + 'm', 10, 10, 'black', 60)\n \n if key.space:\n speed += 1\n hint.hidden = True\n status = 1\n elif speed \u003e 0:\n speed -= 1\n status = 2\n else:\n speed = 0\n \n i = 0\n while i \u003c len(items):\n items[i].x += speed\n i += 1\n \n if player.x \u003c items[10].x:\n player.y += 15\n \n if speed == 0 and status == 2:\n reset_btn.hidden = False\n \n if key.r: reset()\n \n if status == 1:\n player.costume_id = (items[0].x // 300) % 2\n else:\n player.costume_id = 2\n \n expose.hidden = not status == 2 or speed \u003c= 0 or player.y \u003e 450\n expose.scale = 1.1 if items[0].x % 300 \u003e 150 else 1\n\ndef reset():\n global status\n player.y = 450\n reset_btn.hidden = True\n status = 1\n diff = items[0].x - 600\n i = 0\n while i \u003c len(items):\n items[i].x -= diff\n i += 1\n\nreset_btn.on('click', reset)\nforever(loop)\n","created_at":"2024-06-05T14:34:44.782+08:00","updated_at":"2024-06-05T14:54:16.560+08:00","name":"懸崖衝刺_while 版本","language":"python","screenshot":{"url":"https://cdn4.koding.school/uploads/project/screenshot/765665/561f0576ecb4c60da61a44d35a694c5a.jpg"},"parent_id":760838,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":45,"hashid":"rdvsvqyd3","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":17090850,"file_name":"k_0.png","project_id":765665,"asset_id":161769,"created_at":"2024-06-05T14:34:44.787+08:00","updated_at":"2024-06-05T14:34:44.787+08:00"},{"id":17090851,"file_name":"k_1.png","project_id":765665,"asset_id":161770,"created_at":"2024-06-05T14:34:44.789+08:00","updated_at":"2024-06-05T14:34:44.789+08:00"},{"id":17090852,"file_name":"6.png","project_id":765665,"asset_id":745166,"created_at":"2024-06-05T14:34:44.790+08:00","updated_at":"2024-06-05T14:34:44.790+08:00"},{"id":17090853,"file_name":"7.png","project_id":765665,"asset_id":745167,"created_at":"2024-06-05T14:34:44.791+08:00","updated_at":"2024-06-05T14:34:44.791+08:00"},{"id":17090854,"file_name":"8.png","project_id":765665,"asset_id":745168,"created_at":"2024-06-05T14:34:44.792+08:00","updated_at":"2024-06-05T14:34:44.792+08:00"},{"id":17090855,"file_name":"10.png","project_id":765665,"asset_id":745169,"created_at":"2024-06-05T14:34:44.792+08:00","updated_at":"2024-06-05T14:34:44.792+08:00"},{"id":17090856,"file_name":"tree.png","project_id":765665,"asset_id":745171,"created_at":"2024-06-05T14:34:44.793+08:00","updated_at":"2024-06-05T14:34:44.793+08:00"},{"id":17090857,"file_name":"2.png","project_id":765665,"asset_id":745162,"created_at":"2024-06-05T14:34:44.794+08:00","updated_at":"2024-06-05T14:34:44.794+08:00"},{"id":17090858,"file_name":"3.png","project_id":765665,"asset_id":745163,"created_at":"2024-06-05T14:34:44.795+08:00","updated_at":"2024-06-05T14:34:44.795+08:00"},{"id":17090859,"file_name":"expose.png","project_id":765665,"asset_id":745173,"created_at":"2024-06-05T14:34:44.796+08:00","updated_at":"2024-06-05T14:34:44.796+08:00"},{"id":17090860,"file_name":"start.png","project_id":765665,"asset_id":745172,"created_at":"2024-06-05T14:34:44.797+08:00","updated_at":"2024-06-05T14:34:44.797+08:00"},{"id":17090861,"file_name":"9.png","project_id":765665,"asset_id":745170,"created_at":"2024-06-05T14:34:44.798+08:00","updated_at":"2024-06-05T14:34:44.798+08:00"},{"id":17090862,"file_name":"g_1.png","project_id":765665,"asset_id":745156,"created_at":"2024-06-05T14:34:44.798+08:00","updated_at":"2024-06-05T14:34:44.798+08:00"},{"id":17090863,"file_name":"g_0.png","project_id":765665,"asset_id":745157,"created_at":"2024-06-05T14:34:44.799+08:00","updated_at":"2024-06-05T14:34:44.799+08:00"},{"id":17090864,"file_name":"bg.png","project_id":765665,"asset_id":745159,"created_at":"2024-06-05T14:34:44.800+08:00","updated_at":"2024-06-05T14:34:44.800+08:00"},{"id":17090865,"file_name":"4.png","project_id":765665,"asset_id":745164,"created_at":"2024-06-05T14:34:44.801+08:00","updated_at":"2024-06-05T14:34:44.801+08:00"},{"id":17090866,"file_name":"5.png","project_id":765665,"asset_id":745165,"created_at":"2024-06-05T14:34:44.802+08:00","updated_at":"2024-06-05T14:34:44.802+08:00"},{"id":17090867,"file_name":"k_2.png","project_id":765665,"asset_id":745174,"created_at":"2024-06-05T14:34:44.803+08:00","updated_at":"2024-06-05T14:34:44.803+08:00"},{"id":17090868,"file_name":"0.png","project_id":765665,"asset_id":745160,"created_at":"2024-06-05T14:34:44.804+08:00","updated_at":"2024-06-05T14:34:44.804+08:00"},{"id":17090869,"file_name":"1.png","project_id":765665,"asset_id":745161,"created_at":"2024-06-05T14:34:44.804+08:00","updated_at":"2024-06-05T14:34:44.804+08:00"},{"id":17090870,"file_name":"r_hint.png","project_id":765665,"asset_id":745210,"created_at":"2024-06-05T14:34:44.805+08:00","updated_at":"2024-06-05T14:34:44.805+08:00"},{"id":17090871,"file_name":"hint_space.png","project_id":765665,"asset_id":745211,"created_at":"2024-06-05T14:34:44.806+08:00","updated_at":"2024-06-05T14:34:44.806+08:00"},{"id":17090872,"file_name":"r_hint.png","project_id":765665,"asset_id":745210,"created_at":"2024-06-05T14:34:44.807+08:00","updated_at":"2024-06-05T14:34:44.807+08:00"},{"id":17090873,"file_name":"hint_space.png","project_id":765665,"asset_id":745211,"created_at":"2024-06-05T14:34:44.808+08:00","updated_at":"2024-06-05T14:34:44.808+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦