{"id":716384,"student_id":10,"content":"from game import *\nfrom random import *\n\nanswer = None\nk_imgs = ['k_' + str(i) + '.png' for i in range(12)]\np_imgs = ['p_' + str(i) + '.png' for i in range(12)]\nkids = []\nscore = 0\nmove = -1\nclock = 0\n\ncreate_sprite('bg_0.png')\nfather = create_sprite(p_imgs)\nmother = create_sprite(p_imgs)\nselect = create_sprite(k_imgs)\nfather.x = 425\nmother.x = 775\nselect.y = 480\nmother.direction = 270\nmother.rotation_style = 'flipped'\nselect.hidden = True\nfailed = None\ncreate_sprite('bg_1.png')\n\nfor i in range(6):\n kid = create_sprite(k_imgs)\n kid.x = 100 + i * 200\n kid.y = 750\n kid.costume_id = i * 2 + 1\n kids.append(kid)\n \n def click(kid = kid):\n global score, failed\n select.costume_id = kid.costume_id\n select.hidden = False\n kid.hidden = True\n if kid.costume_id == answer: score += 1\n else: gameover()\n kid.on('click', click)\n \ndef gameover():\n global failed\n failed = kids[answer // 2]\n\ndef next_level():\n global answer\n answer = randrange(0, 6) * 2 + 1\n father.costume_id = (answer - 1 + 12) % 12\n mother.costume_id = (answer + 1 + 12) % 12\n select.hidden = True\n for k in kids: k.hidden = False\n\ndef loop():\n global move, clock\n clock += 1\n if failed:\n failed.hidden = (clock // 30) % 2 \n draw_text('遊戲結束! 正確' + str(score), 50, 50, 'black', 50)\n else:\n for s in [father, mother, select]: s.y += move\n if select.y \u003c 400: move = 1\n if select.y \u003e 800:\n move = -1\n if select.hidden: gameover()\n next_level()\n draw_text('正確' + str(score), 50, 50, 'black', 50)\n\nforever(loop)\nnext_level()","created_at":"2024-03-19T18:59:07.502+08:00","updated_at":"2024-04-11T17:31:26.040+08:00","name":"走失協尋專家","language":"python","screenshot":{"url":"https://cdn7.koding.school/uploads/project/screenshot/716384/b8666c28ecad1ba77006a2e0719d5282.jpg"},"parent_id":4,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":70,"hashid":"yeysgdrm3","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":16024840,"file_name":"p_8.png","project_id":716384,"asset_id":728974,"created_at":"2024-03-20T14:59:40.377+08:00","updated_at":"2024-03-20T14:59:40.377+08:00"},{"id":16024841,"file_name":"p_9.png","project_id":716384,"asset_id":728975,"created_at":"2024-03-20T14:59:40.380+08:00","updated_at":"2024-03-20T14:59:40.380+08:00"},{"id":16024820,"file_name":"k_0.png","project_id":716384,"asset_id":728954,"created_at":"2024-03-20T14:59:35.911+08:00","updated_at":"2024-03-20T14:59:35.911+08:00"},{"id":16024821,"file_name":"k_1.png","project_id":716384,"asset_id":728955,"created_at":"2024-03-20T14:59:35.913+08:00","updated_at":"2024-03-20T14:59:35.913+08:00"},{"id":16024237,"file_name":"bg.png","project_id":716384,"asset_id":728953,"created_at":"2024-03-20T10:29:28.278+08:00","updated_at":"2024-03-20T10:29:28.278+08:00"},{"id":16022090,"file_name":"7.png","project_id":716384,"asset_id":728929,"created_at":"2024-03-19T18:59:32.656+08:00","updated_at":"2024-03-19T18:59:32.656+08:00"},{"id":16022091,"file_name":"5.png","project_id":716384,"asset_id":728930,"created_at":"2024-03-19T18:59:32.657+08:00","updated_at":"2024-03-19T18:59:32.657+08:00"},{"id":16024842,"file_name":"p_10.png","project_id":716384,"asset_id":728976,"created_at":"2024-03-20T14:59:40.816+08:00","updated_at":"2024-03-20T14:59:40.816+08:00"},{"id":16024843,"file_name":"p_11.png","project_id":716384,"asset_id":728977,"created_at":"2024-03-20T14:59:40.819+08:00","updated_at":"2024-03-20T14:59:40.819+08:00"},{"id":16024824,"file_name":"k_4.png","project_id":716384,"asset_id":728958,"created_at":"2024-03-20T14:59:36.832+08:00","updated_at":"2024-03-20T14:59:36.832+08:00"},{"id":16024825,"file_name":"k_5.png","project_id":716384,"asset_id":728959,"created_at":"2024-03-20T14:59:36.833+08:00","updated_at":"2024-03-20T14:59:36.833+08:00"},{"id":16024834,"file_name":"p_2.png","project_id":716384,"asset_id":728968,"created_at":"2024-03-20T14:59:39.028+08:00","updated_at":"2024-03-20T14:59:39.028+08:00"},{"id":16024835,"file_name":"p_3.png","project_id":716384,"asset_id":728969,"created_at":"2024-03-20T14:59:39.043+08:00","updated_at":"2024-03-20T14:59:39.043+08:00"},{"id":16022092,"file_name":"3.png","project_id":716384,"asset_id":728931,"created_at":"2024-03-19T18:59:33.073+08:00","updated_at":"2024-03-19T18:59:33.073+08:00"},{"id":16022093,"file_name":"1.png","project_id":716384,"asset_id":728932,"created_at":"2024-03-19T18:59:33.074+08:00","updated_at":"2024-03-19T18:59:33.074+08:00"},{"id":16024830,"file_name":"k_10.png","project_id":716384,"asset_id":728964,"created_at":"2024-03-20T14:59:38.153+08:00","updated_at":"2024-03-20T14:59:38.153+08:00"},{"id":16024831,"file_name":"k_11.png","project_id":716384,"asset_id":728965,"created_at":"2024-03-20T14:59:38.156+08:00","updated_at":"2024-03-20T14:59:38.156+08:00"},{"id":16024832,"file_name":"p_0.png","project_id":716384,"asset_id":728966,"created_at":"2024-03-20T14:59:38.580+08:00","updated_at":"2024-03-20T14:59:38.580+08:00"},{"id":16024833,"file_name":"p_1.png","project_id":716384,"asset_id":728967,"created_at":"2024-03-20T14:59:38.582+08:00","updated_at":"2024-03-20T14:59:38.582+08:00"},{"id":16022088,"file_name":"11.png","project_id":716384,"asset_id":728927,"created_at":"2024-03-19T18:59:32.268+08:00","updated_at":"2024-03-19T18:59:32.268+08:00"},{"id":16022089,"file_name":"9.png","project_id":716384,"asset_id":728928,"created_at":"2024-03-19T18:59:32.270+08:00","updated_at":"2024-03-19T18:59:32.270+08:00"},{"id":16022094,"file_name":"10.png","project_id":716384,"asset_id":728933,"created_at":"2024-03-19T18:59:33.473+08:00","updated_at":"2024-03-19T18:59:33.473+08:00"},{"id":16022095,"file_name":"8.png","project_id":716384,"asset_id":728934,"created_at":"2024-03-19T18:59:33.475+08:00","updated_at":"2024-03-19T18:59:33.475+08:00"},{"id":16022096,"file_name":"6.png","project_id":716384,"asset_id":728935,"created_at":"2024-03-19T18:59:33.854+08:00","updated_at":"2024-03-19T18:59:33.854+08:00"},{"id":16022097,"file_name":"4.png","project_id":716384,"asset_id":728936,"created_at":"2024-03-19T18:59:33.856+08:00","updated_at":"2024-03-19T18:59:33.856+08:00"},{"id":16022098,"file_name":"2.png","project_id":716384,"asset_id":728937,"created_at":"2024-03-19T18:59:34.238+08:00","updated_at":"2024-03-19T18:59:34.238+08:00"},{"id":16022099,"file_name":"0.png","project_id":716384,"asset_id":728938,"created_at":"2024-03-19T18:59:34.240+08:00","updated_at":"2024-03-19T18:59:34.240+08:00"},{"id":16024826,"file_name":"k_6.png","project_id":716384,"asset_id":728960,"created_at":"2024-03-20T14:59:37.370+08:00","updated_at":"2024-03-20T14:59:37.370+08:00"},{"id":16024827,"file_name":"k_7.png","project_id":716384,"asset_id":728961,"created_at":"2024-03-20T14:59:37.372+08:00","updated_at":"2024-03-20T14:59:37.372+08:00"},{"id":16024836,"file_name":"p_4.png","project_id":716384,"asset_id":728970,"created_at":"2024-03-20T14:59:39.509+08:00","updated_at":"2024-03-20T14:59:39.509+08:00"},{"id":16024837,"file_name":"p_5.png","project_id":716384,"asset_id":728971,"created_at":"2024-03-20T14:59:39.511+08:00","updated_at":"2024-03-20T14:59:39.511+08:00"},{"id":16024838,"file_name":"p_6.png","project_id":716384,"asset_id":728972,"created_at":"2024-03-20T14:59:39.968+08:00","updated_at":"2024-03-20T14:59:39.968+08:00"},{"id":16024839,"file_name":"p_7.png","project_id":716384,"asset_id":728973,"created_at":"2024-03-20T14:59:39.969+08:00","updated_at":"2024-03-20T14:59:39.969+08:00"},{"id":16024822,"file_name":"k_2.png","project_id":716384,"asset_id":728956,"created_at":"2024-03-20T14:59:36.417+08:00","updated_at":"2024-03-20T14:59:36.417+08:00"},{"id":16024823,"file_name":"k_3.png","project_id":716384,"asset_id":728957,"created_at":"2024-03-20T14:59:36.420+08:00","updated_at":"2024-03-20T14:59:36.420+08:00"},{"id":16024828,"file_name":"k_8.png","project_id":716384,"asset_id":728962,"created_at":"2024-03-20T14:59:37.773+08:00","updated_at":"2024-03-20T14:59:37.773+08:00"},{"id":16024829,"file_name":"k_9.png","project_id":716384,"asset_id":728963,"created_at":"2024-03-20T14:59:37.774+08:00","updated_at":"2024-03-20T14:59:37.774+08:00"},{"id":16245860,"file_name":"bg_0.png","project_id":716384,"asset_id":732723,"created_at":"2024-04-11T17:22:44.657+08:00","updated_at":"2024-04-11T17:22:44.657+08:00"},{"id":16245861,"file_name":"bg_1.png","project_id":716384,"asset_id":732724,"created_at":"2024-04-11T17:22:44.661+08:00","updated_at":"2024-04-11T17:22:44.661+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦