{"id":781382,"student_id":10,"content":"from game import *\n\np1 = create_sprite('pie.png')\np2 = create_sprite('pie.png')\np3 = create_sprite('pie.png')\np4 = create_sprite('pie.png')\np5 = create_sprite('pie.png')\np6 = create_sprite('pie.png')\np1.direction = 60 * 0\np2.direction = 60 * 1\np3.direction = 60 * 2\np4.direction = 60 * 3\np5.direction = 60 * 4\np6.direction = 60 * 5\n\nplayer = create_sprite('koding.png')\nplayer.direction =\n\ndiff = None\nstart = None\nscore = 0\n\ndef reset():\n global diff, start\n diff = None\n start = None\n p1.opacity = 0.1\n p2.opacity = 0.1\n p3.opacity = 0.1\n p4.opacity = 0.1\n p5.opacity = 0.1\n p6.opacity = 0.1\n\ndef loop():\n global diff, start, score\n \n if cursor.is_down:\n if diff == None:\n tmp = player.direction\n player.toward(cursor)\n diff = player.direction - tmp\n player.direction = tmp\n player.toward(cursor)\n player.direction -= diff\n else:\n reset()\n \n i = (player.direction + 360) % 360 // 60\n \n if cursor.is_down:\n if start == None: start = i\n if i == 0: p1.opacity = 0.5\n if i == 1: p2.opacity = 0.5\n if i == 2: p3.opacity = 0.5\n if i == 3: p4.opacity = 0.5\n if i == 4: p5.opacity = 0.5\n if i == 5: p6.opacity = 0.5\n \n if (p1.opacity == 0.5 and p2.opacity == 0.5 and p3.opacity == 0.5 and \n p4.opacity == 0.5 and p5.opacity == 0.5 and p6.opacity == 0.5 and start == i):\n reset()\n score += 1\n \n draw_text(player.direction, 30, 30, 'black', 30)\n draw_text(score, 30, 60, 'black', 30)\n \n\nforever(loop)\nreset()\n\n\n","created_at":"2024-06-30T15:28:33.873+08:00","updated_at":"2024-07-01T14:48:09.016+08:00","name":"體操","language":"python","screenshot":{"url":"https://cdn8.koding.school/uploads/project/screenshot/781382/e8d2f4194cd54ca47b5a065b7efed204.jpg"},"parent_id":4,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":39,"hashid":"gk4s8gmd3","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":17407524,"file_name":"pie.png","project_id":781382,"asset_id":752097,"created_at":"2024-07-01T14:22:07.110+08:00","updated_at":"2024-07-01T14:22:07.110+08:00"},{"id":17407534,"file_name":"koding.png","project_id":781382,"asset_id":752102,"created_at":"2024-07-01T14:47:53.121+08:00","updated_at":"2024-07-01T14:47:53.121+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦