{"id":765423,"student_id":10,"content":"from game import *\nfrom random import *\n\np1 = create_sprite('0.png', '7.png', '8.png')\np2 = create_sprite('0.png', '5.png', '6.png', '9.png', '10.png')\np3 = create_sprite('0.png', '7.png', '8.png')\np4 = create_sprite('0.png')\np1.move_to(150, 450)\np2.move_to(450, 450)\np3.move_to(750, 450)\np4.move_to(1050, 450)\nh1 = create_sprite('h1.png', 'h2.png', 'h3.png', 'h4.png', 'h5.png')\nh2 = create_sprite('h1.png', 'h2.png', 'h3.png', 'h4.png', 'h5.png')\nh3 = create_sprite('h1.png', 'h2.png', 'h3.png', 'h4.png', 'h5.png')\nh4 = create_sprite('h1.png', 'h2.png', 'h3.png', 'h4.png', 'h5.png')\nh1.move_to(150, 650)\nh2.move_to(450, 650)\nh3.move_to(750, 650)\nh4.move_to(1050, 650)\nrules = create_sprite('rules.png')\nlights = create_sprite('a.png', 'b.png', 'c.png', 'd.png', 'e.png')\n\nclock = 0\nstatus = '0'\nput = True\nscore = 0\n\nh1.costume_id = 1\nh2.costume_id = 2\nh3.costume_id = 0\nh4.costume_id = 0\n\ndef loop():\n global clock, status, put\n \n if key.enter: rules.hidden = True\n if not rules.hidden: return\n \n if status == '1' and p1.costume_id == 0:\n if key.left: status = '2'\n if key.down: put = True\n if status == '0':\n put = False\n \n if clock % (20 - score // 10) == 0:\n if status == '0': move_right()\n elif status == '1': put_abc()\n elif status == '2': move_left()\n elif status == '3': put_b()\n\n clock += 1\n draw_text('出貨:' + str(score), 30, 30, 'black', 50)\n \n lights.costume_id = status\n \ndef move_right():\n global status, score\n h1.x += 100\n h2.x += 100\n h3.x += 100\n h4.x += 100\n if h4.x == 1350:\n h1.x -= 300\n h2.x -= 300\n h3.x -= 300\n h4.x -= 300\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 = '1'\n score += 1\n \ndef move_left():\n global status\n h1.x -= 100\n h2.x -= 100\n h3.x -= 100\n h4.x -= 100\n if h4.x == 750:\n h1.x += 300\n h2.x += 300\n h3.x += 300\n h4.x += 300\n h1.costume_id = h2.costume_id\n h2.costume_id = h3.costume_id\n h3.costume_id = h4.costume_id\n h4.costume_id = 0\n status = '3'\n \ndef put_abc():\n put_a()\n put_b()\n if put: put_c()\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 global status\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 = '0'\n \ndef put_c():\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 == 1: h3.costume_id = 4\n if h3.costume_id == 2: h3.costume_id = 3\n\nforever(loop)\n\n\n\n","created_at":"2024-06-03T11:13:20.535+08:00","updated_at":"2024-06-07T11:37:29.084+08:00","name":"漢堡工廠","language":"python","screenshot":{"url":"https://cdn5.koding.school/uploads/project/screenshot/765423/83ae9e14f92789beb2f8b45fad95ae13.jpg"},"parent_id":4,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":76,"hashid":"2pdsygzz6","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":17086708,"file_name":"0.png","project_id":765423,"asset_id":746531,"created_at":"2024-06-03T13:42:45.969+08:00","updated_at":"2024-06-03T13:42:45.969+08:00"},{"id":17086706,"file_name":"2.png","project_id":765423,"asset_id":746529,"created_at":"2024-06-03T13:42:45.500+08:00","updated_at":"2024-06-03T13:42:45.500+08:00"},{"id":17086707,"file_name":"1.png","project_id":765423,"asset_id":746530,"created_at":"2024-06-03T13:42:45.502+08:00","updated_at":"2024-06-03T13:42:45.502+08:00"},{"id":17086698,"file_name":"10.png","project_id":765423,"asset_id":746521,"created_at":"2024-06-03T13:42:40.000+08:00","updated_at":"2024-06-03T13:42:40.000+08:00"},{"id":17086699,"file_name":"9.png","project_id":765423,"asset_id":746522,"created_at":"2024-06-03T13:42:40.002+08:00","updated_at":"2024-06-03T13:42:40.002+08:00"},{"id":17086700,"file_name":"8.png","project_id":765423,"asset_id":746523,"created_at":"2024-06-03T13:42:40.751+08:00","updated_at":"2024-06-03T13:42:40.751+08:00"},{"id":17086701,"file_name":"7.png","project_id":765423,"asset_id":746524,"created_at":"2024-06-03T13:42:40.752+08:00","updated_at":"2024-06-03T13:42:40.752+08:00"},{"id":17086584,"file_name":"h4.png","project_id":765423,"asset_id":746506,"created_at":"2024-06-03T11:13:33.088+08:00","updated_at":"2024-06-03T11:13:33.088+08:00"},{"id":17086585,"file_name":"h3.png","project_id":765423,"asset_id":746507,"created_at":"2024-06-03T11:13:33.090+08:00","updated_at":"2024-06-03T11:13:33.090+08:00"},{"id":17086586,"file_name":"h2.png","project_id":765423,"asset_id":746508,"created_at":"2024-06-03T11:13:33.481+08:00","updated_at":"2024-06-03T11:13:33.481+08:00"},{"id":17086587,"file_name":"h1.png","project_id":765423,"asset_id":746509,"created_at":"2024-06-03T11:13:33.483+08:00","updated_at":"2024-06-03T11:13:33.483+08:00"},{"id":17086702,"file_name":"6.png","project_id":765423,"asset_id":746525,"created_at":"2024-06-03T13:42:43.877+08:00","updated_at":"2024-06-03T13:42:43.877+08:00"},{"id":17086703,"file_name":"5.png","project_id":765423,"asset_id":746526,"created_at":"2024-06-03T13:42:43.878+08:00","updated_at":"2024-06-03T13:42:43.878+08:00"},{"id":17086710,"file_name":"h5.png","project_id":765423,"asset_id":746532,"created_at":"2024-06-03T14:12:18.796+08:00","updated_at":"2024-06-03T14:12:18.796+08:00"},{"id":17086704,"file_name":"4.png","project_id":765423,"asset_id":746527,"created_at":"2024-06-03T13:42:44.571+08:00","updated_at":"2024-06-03T13:42:44.571+08:00"},{"id":17086705,"file_name":"3.png","project_id":765423,"asset_id":746528,"created_at":"2024-06-03T13:42:44.573+08:00","updated_at":"2024-06-03T13:42:44.573+08:00"},{"id":17098902,"file_name":"c.png","project_id":765423,"asset_id":746748,"created_at":"2024-06-07T11:36:01.464+08:00","updated_at":"2024-06-07T11:36:01.464+08:00"},{"id":17098903,"file_name":"b.png","project_id":765423,"asset_id":746749,"created_at":"2024-06-07T11:36:01.466+08:00","updated_at":"2024-06-07T11:36:01.466+08:00"},{"id":17098861,"file_name":"rules.png","project_id":765423,"asset_id":746745,"created_at":"2024-06-07T10:48:19.434+08:00","updated_at":"2024-06-07T10:48:19.434+08:00"},{"id":17098904,"file_name":"a.png","project_id":765423,"asset_id":746750,"created_at":"2024-06-07T11:36:01.893+08:00","updated_at":"2024-06-07T11:36:01.893+08:00"},{"id":17098900,"file_name":"e.png","project_id":765423,"asset_id":746746,"created_at":"2024-06-07T11:36:00.842+08:00","updated_at":"2024-06-07T11:36:00.842+08:00"},{"id":17098901,"file_name":"d.png","project_id":765423,"asset_id":746747,"created_at":"2024-06-07T11:36:00.844+08:00","updated_at":"2024-06-07T11:36:00.844+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦