{"id":771585,"student_id":10,"content":"from game import *\nfrom random import *\n\nimgs = [str(i) + '.png' for i in range(13)]\np1 = create_sprite(imgs)\np2 = create_sprite(imgs)\np3 = create_sprite(imgs)\np1.x -= 200\np2.y += 100\np3.x += 200\nb1 = create_sprite('b_0.png', 'b_1.png')\nb2 = create_sprite('b_0.png', 'b_1.png')\nb3 = create_sprite('b_0.png', 'b_1.png')\nb4 = create_sprite('b_0.png', 'b_1.png')\nb5 = create_sprite('b_0.png', 'b_1.png')\nb6 = create_sprite('b_0.png', 'b_1.png')\nb1.move(300, -300)\nb2.move(500, 0)\nb3.move(300, 300)\nb4.move(-300, -300)\nb5.move(-500, 0)\nb6.move(-300, 300)\n\nclock = -1\nstatus = 0\nscore = 0\n\ndef loop():\n global clock, status\n clock += 1\n if clock % 30 == 0:\n if status == 4 or status == 9: check()\n if status == 1 or status == 2 or status == 9 or status == 0: move_all(50)\n if status == 4 or status == 5 or status == 6 or status == 7: move_all(-50)\n if status == 1 or status == 4 or status == 6 or status == 9: set_all_costume(1)\n if status == 0 or status == 5: set_all_costume(0)\n if status == 2 or status == 7: random_costume()\n status = (status + 1) % 10\n \n b1.costume_id = 0\n b2.costume_id = 0\n b3.costume_id = 0\n b4.costume_id = 0\n b5.costume_id = 0\n b6.costume_id = 0\n if key.i: b1.costume_id = 1\n if key.j: b1.costume_id = 1\n if key.n: b1.costume_id = 1\n if key.r: b1.costume_id = 1\n if key.f: b1.costume_id = 1\n if key.v: b1.costume_id = 1\n \n if p2.costume_id == 0:\n if key.i: p2.costume_id = 2\n if key.j: p2.costume_id = 3\n if key.n: p2.costume_id = 4\n if key.r: p2.costume_id = 5\n if key.f: p2.costume_id = 6\n if key.v: p2.costume_id = 7\n if key.i and key.r: p2.costume_id = 8\n if key.j and key.f: p2.costume_id = 9\n if key.n and key.v: p2.costume_id = 10\n if key.i and key.v: p2.costume_id = 11\n if key.n and key.r: p2.costume_id = 12\n \n draw_text('得分:' + str(score), 10, 10, 'black', 30)\n \ndef move_all(x):\n p1.x += x\n p2.x += x\n p3.x += x\n \ndef set_all_costume(i):\n p1.costume_id = i\n p2.costume_id = i\n p3.costume_id = i\n\ndef random_costume():\n set_all_costume(1 + randint(1, 6))\n p2.costume_id = 0\n\ndef check():\n global score\n if p1.costume_id != p2.costume_id:\n stop()\n else:\n score += 1\n \nforever(loop)","created_at":"2024-06-17T10:31:43.760+08:00","updated_at":"2024-06-25T13:12:17.887+08:00","name":"跳舞","language":"python","screenshot":{"url":"https://cdn4.koding.school/uploads/project/screenshot/771585/d1b0266a650401f09ef5ed599e1b51d6.jpg"},"parent_id":4,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":45,"hashid":"gk4sn6j9n","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":17205677,"file_name":"11.png","project_id":771585,"asset_id":748762,"created_at":"2024-06-17T10:32:01.401+08:00","updated_at":"2024-06-17T10:32:01.401+08:00"},{"id":17205678,"file_name":"12.png","project_id":771585,"asset_id":748763,"created_at":"2024-06-17T10:32:01.403+08:00","updated_at":"2024-06-17T10:32:01.403+08:00"},{"id":17205685,"file_name":"4.png","project_id":771585,"asset_id":748770,"created_at":"2024-06-17T10:32:03.517+08:00","updated_at":"2024-06-17T10:32:03.517+08:00"},{"id":17205686,"file_name":"2.png","project_id":771585,"asset_id":748771,"created_at":"2024-06-17T10:32:03.519+08:00","updated_at":"2024-06-17T10:32:03.519+08:00"},{"id":17205689,"file_name":"0.png","project_id":771585,"asset_id":748774,"created_at":"2024-06-17T10:32:04.389+08:00","updated_at":"2024-06-17T10:32:04.389+08:00"},{"id":17205679,"file_name":"10.png","project_id":771585,"asset_id":748764,"created_at":"2024-06-17T10:32:01.871+08:00","updated_at":"2024-06-17T10:32:01.871+08:00"},{"id":17205680,"file_name":"9.png","project_id":771585,"asset_id":748765,"created_at":"2024-06-17T10:32:01.873+08:00","updated_at":"2024-06-17T10:32:01.873+08:00"},{"id":17205683,"file_name":"6.png","project_id":771585,"asset_id":748768,"created_at":"2024-06-17T10:32:03.035+08:00","updated_at":"2024-06-17T10:32:03.035+08:00"},{"id":17205684,"file_name":"7.png","project_id":771585,"asset_id":748769,"created_at":"2024-06-17T10:32:03.037+08:00","updated_at":"2024-06-17T10:32:03.037+08:00"},{"id":17205681,"file_name":"8.png","project_id":771585,"asset_id":748766,"created_at":"2024-06-17T10:32:02.386+08:00","updated_at":"2024-06-17T10:32:02.386+08:00"},{"id":17205682,"file_name":"5.png","project_id":771585,"asset_id":748767,"created_at":"2024-06-17T10:32:02.388+08:00","updated_at":"2024-06-17T10:32:02.388+08:00"},{"id":17205690,"file_name":"b_1.png","project_id":771585,"asset_id":748775,"created_at":"2024-06-17T10:33:39.403+08:00","updated_at":"2024-06-17T10:33:39.403+08:00"},{"id":17205691,"file_name":"b_0.png","project_id":771585,"asset_id":748776,"created_at":"2024-06-17T10:33:39.405+08:00","updated_at":"2024-06-17T10:33:39.405+08:00"},{"id":17205687,"file_name":"3.png","project_id":771585,"asset_id":748772,"created_at":"2024-06-17T10:32:03.978+08:00","updated_at":"2024-06-17T10:32:03.978+08:00"},{"id":17205688,"file_name":"1.png","project_id":771585,"asset_id":748773,"created_at":"2024-06-17T10:32:03.980+08:00","updated_at":"2024-06-17T10:32:03.980+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦