{"id":735872,"student_id":10,"content":"from game import *\nfrom random import *\n\nimgs = [str(i) + '.png' for i in range(32)]\nblocks = []\nflags = []\nstart = None\nactive = False\nclock = 0\n\nfor x in range(20):\n for y in range(15):\n b = game.create_sprite('b_2.png')\n b.x = 30 + 60 * x\n b.y = 30 + 60 * y\n b.layer = -1\n b.costume_id = (x + y) % 2\n blocks.append(b)\n\n f = game.create_sprite(imgs)\n f.dx = 30 + 60 * x\n f.dy = 30 + 60 * y\n f.scale = 0.6\n f.rotation_style = 'fixed'\n f.costume_id = (y*12 + x) // 2 % 32\n flags.append(f)\n\ndef shuffle():\n for i in range(300):\n f1 = flags[i]\n f2 = flags[randint(0, 299)]\n if not f1.hidden and not f2.hidden:\n f1.dx, f2.dx = f2.dx, f1.dx\n f1.dy, f2.dy = f2.dy, f1.dy\n \ndef loop():\n global start, clock\n \n for w in blocks:\n if start and abs(w.x - cursor.x) \u003c 50 and abs(w.y - cursor.y) \u003c 50:\n w.hidden = False\n if not start:\n w.hidden = True\n \n for f in flags:\n if start and f.touched(cursor) and f.costume_id != start.costume_id:\n start = None\n if f.distance_to(f.dx, f.dy) \u003e 10:\n f.toward(f.dx, f.dy)\n f.step_forward(10)\n else:\n f.move_to(f.dx, f.dy)\n \n clock += 1\n if clock % (60 * 30) == 0:\n shuffle()\n \ndef mousedown():\n global start\n for f in flags:\n if f.touched(cursor):\n start = f\n\ndef mouseup():\n global start\n for f in flags:\n if start and f.touched(cursor) and f.costume_id == start.costume_id and f is not start:\n f.hidden = True\n start.hidden = True\n start = None\n\non('mousedown', mousedown)\non('mouseup', mouseup)\nforever(loop)\nshuffle()","created_at":"2024-04-24T10:34:45.829+08:00","updated_at":"2024-04-24T10:50:47.068+08:00","name":"國旗配對碰","language":"python","screenshot":{"url":"https://cdn2.koding.school/uploads/project/screenshot/735872/38316b5857a450e905316af6cdcd0efe.jpg"},"parent_id":4,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":153,"hashid":"2pdsy8wz4","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":16441871,"file_name":"24.png","project_id":735872,"asset_id":729044,"created_at":"2024-04-24T10:40:16.161+08:00","updated_at":"2024-04-24T10:40:16.161+08:00"},{"id":16441872,"file_name":"25.png","project_id":735872,"asset_id":729045,"created_at":"2024-04-24T10:40:16.163+08:00","updated_at":"2024-04-24T10:40:16.163+08:00"},{"id":16441850,"file_name":"3.png","project_id":735872,"asset_id":729023,"created_at":"2024-04-24T10:40:11.514+08:00","updated_at":"2024-04-24T10:40:11.514+08:00"},{"id":16441881,"file_name":"2.png","project_id":735872,"asset_id":729022,"created_at":"2024-04-24T10:41:00.855+08:00","updated_at":"2024-04-24T10:41:00.855+08:00"},{"id":16441879,"file_name":"0.png","project_id":735872,"asset_id":729020,"created_at":"2024-04-24T10:41:00.463+08:00","updated_at":"2024-04-24T10:41:00.463+08:00"},{"id":16441880,"file_name":"1.png","project_id":735872,"asset_id":729021,"created_at":"2024-04-24T10:41:00.465+08:00","updated_at":"2024-04-24T10:41:00.465+08:00"},{"id":16441869,"file_name":"22.png","project_id":735872,"asset_id":729042,"created_at":"2024-04-24T10:40:15.767+08:00","updated_at":"2024-04-24T10:40:15.767+08:00"},{"id":16441870,"file_name":"23.png","project_id":735872,"asset_id":729043,"created_at":"2024-04-24T10:40:15.770+08:00","updated_at":"2024-04-24T10:40:15.770+08:00"},{"id":16441875,"file_name":"28.png","project_id":735872,"asset_id":729048,"created_at":"2024-04-24T10:40:16.978+08:00","updated_at":"2024-04-24T10:40:16.978+08:00"},{"id":16441876,"file_name":"29.png","project_id":735872,"asset_id":729049,"created_at":"2024-04-24T10:40:16.980+08:00","updated_at":"2024-04-24T10:40:16.980+08:00"},{"id":16441857,"file_name":"10.png","project_id":735872,"asset_id":729030,"created_at":"2024-04-24T10:40:13.218+08:00","updated_at":"2024-04-24T10:40:13.218+08:00"},{"id":16441858,"file_name":"11.png","project_id":735872,"asset_id":729031,"created_at":"2024-04-24T10:40:13.220+08:00","updated_at":"2024-04-24T10:40:13.220+08:00"},{"id":16441845,"file_name":"b_0.png","project_id":735872,"asset_id":735979,"created_at":"2024-04-24T10:35:02.759+08:00","updated_at":"2024-04-24T10:35:02.759+08:00"},{"id":16441851,"file_name":"4.png","project_id":735872,"asset_id":729024,"created_at":"2024-04-24T10:40:11.934+08:00","updated_at":"2024-04-24T10:40:11.934+08:00"},{"id":16441852,"file_name":"5.png","project_id":735872,"asset_id":729025,"created_at":"2024-04-24T10:40:11.936+08:00","updated_at":"2024-04-24T10:40:11.936+08:00"},{"id":16441863,"file_name":"16.png","project_id":735872,"asset_id":729036,"created_at":"2024-04-24T10:40:14.496+08:00","updated_at":"2024-04-24T10:40:14.496+08:00"},{"id":16441864,"file_name":"17.png","project_id":735872,"asset_id":729037,"created_at":"2024-04-24T10:40:14.498+08:00","updated_at":"2024-04-24T10:40:14.498+08:00"},{"id":16441873,"file_name":"26.png","project_id":735872,"asset_id":729046,"created_at":"2024-04-24T10:40:16.561+08:00","updated_at":"2024-04-24T10:40:16.561+08:00"},{"id":16441874,"file_name":"27.png","project_id":735872,"asset_id":729047,"created_at":"2024-04-24T10:40:16.563+08:00","updated_at":"2024-04-24T10:40:16.563+08:00"},{"id":16441853,"file_name":"6.png","project_id":735872,"asset_id":729026,"created_at":"2024-04-24T10:40:12.310+08:00","updated_at":"2024-04-24T10:40:12.310+08:00"},{"id":16441854,"file_name":"7.png","project_id":735872,"asset_id":729027,"created_at":"2024-04-24T10:40:12.312+08:00","updated_at":"2024-04-24T10:40:12.312+08:00"},{"id":16441865,"file_name":"18.png","project_id":735872,"asset_id":729038,"created_at":"2024-04-24T10:40:14.894+08:00","updated_at":"2024-04-24T10:40:14.894+08:00"},{"id":16441866,"file_name":"19.png","project_id":735872,"asset_id":729039,"created_at":"2024-04-24T10:40:14.896+08:00","updated_at":"2024-04-24T10:40:14.896+08:00"},{"id":16441877,"file_name":"30.png","project_id":735872,"asset_id":729050,"created_at":"2024-04-24T10:40:17.402+08:00","updated_at":"2024-04-24T10:40:17.402+08:00"},{"id":16441878,"file_name":"31.png","project_id":735872,"asset_id":729051,"created_at":"2024-04-24T10:40:17.404+08:00","updated_at":"2024-04-24T10:40:17.404+08:00"},{"id":16441855,"file_name":"8.png","project_id":735872,"asset_id":729028,"created_at":"2024-04-24T10:40:12.767+08:00","updated_at":"2024-04-24T10:40:12.767+08:00"},{"id":16441856,"file_name":"9.png","project_id":735872,"asset_id":729029,"created_at":"2024-04-24T10:40:12.768+08:00","updated_at":"2024-04-24T10:40:12.768+08:00"},{"id":16441861,"file_name":"14.png","project_id":735872,"asset_id":729034,"created_at":"2024-04-24T10:40:14.085+08:00","updated_at":"2024-04-24T10:40:14.085+08:00"},{"id":16441862,"file_name":"15.png","project_id":735872,"asset_id":729035,"created_at":"2024-04-24T10:40:14.087+08:00","updated_at":"2024-04-24T10:40:14.087+08:00"},{"id":16441843,"file_name":"b_2.png","project_id":735872,"asset_id":735977,"created_at":"2024-04-24T10:35:02.407+08:00","updated_at":"2024-04-24T10:35:02.407+08:00"},{"id":16441844,"file_name":"b_1.png","project_id":735872,"asset_id":735978,"created_at":"2024-04-24T10:35:02.409+08:00","updated_at":"2024-04-24T10:35:02.409+08:00"},{"id":16441867,"file_name":"20.png","project_id":735872,"asset_id":729040,"created_at":"2024-04-24T10:40:15.302+08:00","updated_at":"2024-04-24T10:40:15.302+08:00"},{"id":16441868,"file_name":"21.png","project_id":735872,"asset_id":729041,"created_at":"2024-04-24T10:40:15.304+08:00","updated_at":"2024-04-24T10:40:15.304+08:00"},{"id":16441859,"file_name":"12.png","project_id":735872,"asset_id":729032,"created_at":"2024-04-24T10:40:13.630+08:00","updated_at":"2024-04-24T10:40:13.630+08:00"},{"id":16441860,"file_name":"13.png","project_id":735872,"asset_id":729033,"created_at":"2024-04-24T10:40:13.632+08:00","updated_at":"2024-04-24T10:40:13.632+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦