{"id":767255,"student_id":10,"content":"from game import *\nfrom random import *\n\nset_backdrop('bg.png')\np1 = create_sprite('p_0.png', 'p_1.png', 'p_2.png', 'p_9.png')\np2 = create_sprite('p_0.png', 'p_3.png', 'p_4.png', 'p_7.png', 'p_8.png', 'p_9.png')\np3 = create_sprite('p_0.png', 'p_5.png', 'p_6.png', 'p_10.png')\np4 = create_sprite('p_0.png', 'p_1.png', 'p_2.png', 'p_12.png')\nh1 = create_sprite('h_0.png', 'h_1.png', 'h_2.png', 'h_3.png', 'h_4.png')\nh2 = create_sprite('h_0.png', 'h_1.png', 'h_2.png', 'h_3.png', 'h_4.png')\nh3 = create_sprite('h_0.png', 'h_1.png', 'h_2.png', 'h_3.png', 'h_4.png')\nh4 = create_sprite('h_0.png', 'h_1.png', 'h_2.png', 'h_3.png', 'h_4.png')\nn1 = create_sprite(['n_' + str(i) + '.png' for i in range(10)])\nn2 = create_sprite(['n_' + str(i) + '.png' for i in range(10)])\nn3 = create_sprite(['n_' + str(i) + '.png' for i in range(10)])\nnn = create_sprite(['text.png'])\nstatus = create_sprite('s1.png', 's2.png', 's3.png', 's4.png', 's5.png')\np1.move_to(150, 450)\np2.move_to(450, 450)\np3.move_to(750, 450)\np4.move_to(1050, 450)\nh1.move_to(150, 650)\nh2.move_to(450, 650)\nh3.move_to(750, 650)\nh4.move_to(1050, 650)\nn1.move_to(70, 75)\nn2.move_to(140, 75)\nn3.move_to(210, 75)\nnn.move_to(350, 75)\nh1.costume_id = 1\nstatus.move_to(1000, 50)\n\nclock = 0\nactive = False\nscore = 0\n\nbgm = create_sound('bgm.ogg', True)\n\ndef loop():\n global clock, active\n \n clock += 1\n level = score // 5\n if level \u003e 10: level = 10\n if clock % (15 - level) == 0:\n if status.costume_id == 0: move_right()\n elif status.costume_id == 1: put_abc()\n elif status.costume_id == 2: move_left()\n elif status.costume_id == 3: put_b()\n \n if key.down: active = True\n \n if status.costume_id == 0 and key.left:\n status.costume_id = 2\n \n if status.costume_id == 1 and h4.costume_id != 0 and h4.costume_id != 3:\n gameover()\n \n if status.costume_id == 3 and h2.costume_id == 2:\n gameover()\n \n update_score()\n \n if clock % 30 == 0 and status.costume_id == 4:\n n1.hidden = not n1.hidden\n n2.hidden = not n2.hidden\n n3.hidden = not n3.hidden\n nn.hidden = not nn.hidden\n \ndef move_right():\n global score\n h1.x += 50\n h2.x += 50\n h3.x += 50\n h4.x += 50\n if h4.x \u003e= 1350:\n h1.x -= 300\n h2.x -= 300\n h3.x -= 300\n h4.x -= 300\n if h4.costume_id == 3: score += 1\n h4.costume_id = h3.costume_id\n h3.costume_id = h2.costume_id\n h2.costume_id = h1.costume_id\n h1.costume_id = 0\n status.costume_id = 1\n\ndef move_left():\n h1.x -= 50\n h2.x -= 50\n h3.x -= 50\n h4.x -= 50\n if h4.x \u003c= 1050:\n status.costume_id = 3\n\ndef put_abc():\n put_a()\n if h2.costume_id == 1: put_b()\n if active: put_c()\n create_sound('put.ogg')\n\ndef put_a():\n if p1.costume_id == 0:\n p1.costume_id = 1\n elif p1.costume_id == 1:\n p1.costume_id = 2\n else:\n p1.costume_id = 0\n h1.costume_id += 1\n\ndef put_b():\n if p2.costume_id == 0:\n p2.costume_id = 1\n if random() \u003c 0.2: p2.costume_id = 3\n elif p2.costume_id == 1:\n p2.costume_id = 2\n elif p2.costume_id == 3:\n p2.costume_id = 4\n else:\n if p2.costume_id == 2: h2.costume_id += 1\n p2.costume_id = 0\n status.costume_id = 0\n\ndef put_c():\n global active\n if p3.costume_id == 0:\n p3.costume_id = 1\n elif p3.costume_id == 1:\n p3.costume_id = 2\n else:\n p3.costume_id = 0\n if h3.costume_id == 2: h3.costume_id = 3\n if h3.costume_id == 1: h3.costume_id = 4\n active = False\n\ndef update_score():\n n1.costume_id = (score // 100) % 10\n n2.costume_id = (score // 10) % 10\n n3.costume_id = (score // 1) % 10\n\ndef gameover():\n p1.costume_id = 3\n p2.costume_id = 5\n p3.costume_id = 3\n p4.costume_id = 3\n status.costume_id = 4\n bgm.pause()\n create_sound('error.ogg')\n \nforever(loop)","created_at":"2024-06-14T16:10:16.856+08:00","updated_at":"2024-06-30T22:15:04.890+08:00","name":"漢堡工廠","language":"python","screenshot":{"url":"https://cdn1.koding.school/uploads/project/screenshot/767255/d7f72eb85f77b49e3fb4f79f33aa33bb.jpg"},"parent_id":4,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":43,"hashid":"ej9sen4zj","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":17121230,"file_name":"n_6.png","project_id":767255,"asset_id":747479,"created_at":"2024-06-14T16:12:09.497+08:00","updated_at":"2024-06-14T16:12:09.497+08:00"},{"id":17121231,"file_name":"n_7.png","project_id":767255,"asset_id":747480,"created_at":"2024-06-14T16:12:09.498+08:00","updated_at":"2024-06-14T16:12:09.498+08:00"},{"id":17121242,"file_name":"p_8.png","project_id":767255,"asset_id":747491,"created_at":"2024-06-14T16:12:11.582+08:00","updated_at":"2024-06-14T16:12:11.582+08:00"},{"id":17121243,"file_name":"p_9.png","project_id":767255,"asset_id":747492,"created_at":"2024-06-14T16:12:11.584+08:00","updated_at":"2024-06-14T16:12:11.584+08:00"},{"id":17121244,"file_name":"p_10.png","project_id":767255,"asset_id":747493,"created_at":"2024-06-14T16:12:11.868+08:00","updated_at":"2024-06-14T16:12:11.868+08:00"},{"id":17121245,"file_name":"p_11.png","project_id":767255,"asset_id":747494,"created_at":"2024-06-14T16:12:11.869+08:00","updated_at":"2024-06-14T16:12:11.869+08:00"},{"id":17121250,"file_name":"s4.png","project_id":767255,"asset_id":747499,"created_at":"2024-06-14T16:12:12.576+08:00","updated_at":"2024-06-14T16:12:12.576+08:00"},{"id":17121251,"file_name":"s5.png","project_id":767255,"asset_id":747500,"created_at":"2024-06-14T16:12:12.577+08:00","updated_at":"2024-06-14T16:12:12.577+08:00"},{"id":17121218,"file_name":"bg.png","project_id":767255,"asset_id":747467,"created_at":"2024-06-14T16:12:07.890+08:00","updated_at":"2024-06-14T16:12:07.890+08:00"},{"id":17121219,"file_name":"h_0.png","project_id":767255,"asset_id":747468,"created_at":"2024-06-14T16:12:07.892+08:00","updated_at":"2024-06-14T16:12:07.892+08:00"},{"id":17121220,"file_name":"h_1.png","project_id":767255,"asset_id":747469,"created_at":"2024-06-14T16:12:08.323+08:00","updated_at":"2024-06-14T16:12:08.323+08:00"},{"id":17121221,"file_name":"h_2.png","project_id":767255,"asset_id":747470,"created_at":"2024-06-14T16:12:08.324+08:00","updated_at":"2024-06-14T16:12:08.324+08:00"},{"id":17121222,"file_name":"h_3.png","project_id":767255,"asset_id":747471,"created_at":"2024-06-14T16:12:08.687+08:00","updated_at":"2024-06-14T16:12:08.687+08:00"},{"id":17121223,"file_name":"h_4.png","project_id":767255,"asset_id":747472,"created_at":"2024-06-14T16:12:08.688+08:00","updated_at":"2024-06-14T16:12:08.688+08:00"},{"id":17121226,"file_name":"n_2.png","project_id":767255,"asset_id":747475,"created_at":"2024-06-14T16:12:09.160+08:00","updated_at":"2024-06-14T16:12:09.160+08:00"},{"id":17121227,"file_name":"n_3.png","project_id":767255,"asset_id":747476,"created_at":"2024-06-14T16:12:09.162+08:00","updated_at":"2024-06-14T16:12:09.162+08:00"},{"id":17121228,"file_name":"n_4.png","project_id":767255,"asset_id":747477,"created_at":"2024-06-14T16:12:09.311+08:00","updated_at":"2024-06-14T16:12:09.311+08:00"},{"id":17121229,"file_name":"n_5.png","project_id":767255,"asset_id":747478,"created_at":"2024-06-14T16:12:09.313+08:00","updated_at":"2024-06-14T16:12:09.313+08:00"},{"id":17121238,"file_name":"p_4.png","project_id":767255,"asset_id":747487,"created_at":"2024-06-14T16:12:10.812+08:00","updated_at":"2024-06-14T16:12:10.812+08:00"},{"id":17121239,"file_name":"p_5.png","project_id":767255,"asset_id":747488,"created_at":"2024-06-14T16:12:10.814+08:00","updated_at":"2024-06-14T16:12:10.814+08:00"},{"id":17121240,"file_name":"p_6.png","project_id":767255,"asset_id":747489,"created_at":"2024-06-14T16:12:11.323+08:00","updated_at":"2024-06-14T16:12:11.323+08:00"},{"id":17121241,"file_name":"p_7.png","project_id":767255,"asset_id":747490,"created_at":"2024-06-14T16:12:11.325+08:00","updated_at":"2024-06-14T16:12:11.325+08:00"},{"id":17121252,"file_name":"text.png","project_id":767255,"asset_id":747501,"created_at":"2024-06-14T16:12:12.854+08:00","updated_at":"2024-06-14T16:12:12.854+08:00"},{"id":17121232,"file_name":"n_8.png","project_id":767255,"asset_id":747481,"created_at":"2024-06-14T16:12:09.711+08:00","updated_at":"2024-06-14T16:12:09.711+08:00"},{"id":17121233,"file_name":"n_9.png","project_id":767255,"asset_id":747482,"created_at":"2024-06-14T16:12:09.713+08:00","updated_at":"2024-06-14T16:12:09.713+08:00"},{"id":17121246,"file_name":"p_12.png","project_id":767255,"asset_id":747495,"created_at":"2024-06-14T16:12:12.091+08:00","updated_at":"2024-06-14T16:12:12.091+08:00"},{"id":17121247,"file_name":"s1.png","project_id":767255,"asset_id":747496,"created_at":"2024-06-14T16:12:12.093+08:00","updated_at":"2024-06-14T16:12:12.093+08:00"},{"id":17121224,"file_name":"n_0.png","project_id":767255,"asset_id":747473,"created_at":"2024-06-14T16:12:08.858+08:00","updated_at":"2024-06-14T16:12:08.858+08:00"},{"id":17121225,"file_name":"n_1.png","project_id":767255,"asset_id":747474,"created_at":"2024-06-14T16:12:08.860+08:00","updated_at":"2024-06-14T16:12:08.860+08:00"},{"id":17121234,"file_name":"p_0.png","project_id":767255,"asset_id":747483,"created_at":"2024-06-14T16:12:09.963+08:00","updated_at":"2024-06-14T16:12:09.963+08:00"},{"id":17121235,"file_name":"p_1.png","project_id":767255,"asset_id":747484,"created_at":"2024-06-14T16:12:09.965+08:00","updated_at":"2024-06-14T16:12:09.965+08:00"},{"id":17121236,"file_name":"p_2.png","project_id":767255,"asset_id":747485,"created_at":"2024-06-14T16:12:10.348+08:00","updated_at":"2024-06-14T16:12:10.348+08:00"},{"id":17121237,"file_name":"p_3.png","project_id":767255,"asset_id":747486,"created_at":"2024-06-14T16:12:10.349+08:00","updated_at":"2024-06-14T16:12:10.349+08:00"},{"id":17121248,"file_name":"s2.png","project_id":767255,"asset_id":747497,"created_at":"2024-06-14T16:12:12.385+08:00","updated_at":"2024-06-14T16:12:12.385+08:00"},{"id":17121249,"file_name":"s3.png","project_id":767255,"asset_id":747498,"created_at":"2024-06-14T16:12:12.387+08:00","updated_at":"2024-06-14T16:12:12.387+08:00"},{"id":17205885,"file_name":"bgm.ogg","project_id":767255,"asset_id":748798,"created_at":"2024-06-17T14:33:13.527+08:00","updated_at":"2024-06-17T14:33:13.527+08:00"},{"id":17205886,"file_name":"put.ogg","project_id":767255,"asset_id":175935,"created_at":"2024-06-17T14:38:47.109+08:00","updated_at":"2024-06-17T14:38:47.109+08:00"},{"id":17205887,"file_name":"error.ogg","project_id":767255,"asset_id":723472,"created_at":"2024-06-17T14:39:48.102+08:00","updated_at":"2024-06-17T14:39:48.102+08:00"},{"id":17407352,"file_name":"bgm.ogg","project_id":767255,"asset_id":748798,"created_at":"2024-07-01T10:59:00.762+08:00","updated_at":"2024-07-01T10:59:00.762+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦