{"id":695004,"student_id":10,"content":"from game import *\nfrom random import random\n\nclock = 0\nscore = 0\n\ninfo = create_sprite('info.png', 'end.png')\n\nballs = []\nfor i in range(6):\n b = create_sprite('ball.png')\n balls.append(b)\n def click(b=b):\n b.hidden = True\n b.on('click', click)\n \ndef info_click():\n global score, clock\n for b in balls: b.scale = 0.2\n score = 0\n clock = 0\n info.hidden = True\n \ndef loop():\n global clock, score\n clock += 1\n \n if not info.hidden: return\n \n draw_text(score, 0, 0, 'black', 30)\n draw_text(clock, 0, 30, 'black', 30)\n \n if clock \u003c 60:\n pass\n elif clock == 60:\n for b in balls:\n b.hidden = False\n if score \u003c= 1: balls[1].hidden = True\n if score \u003c= 2: balls[2].hidden = True\n if score \u003c= 3: balls[3].hidden = True\n if score \u003c= 4: balls[4].hidden = True\n if score \u003c= 5: balls[5].hidden = True\n \n elif clock \u003c 120:\n for b in balls:\n b.scale += 0.02\n seperate()\n \n elif clock \u003c 240:\n count = 0\n for b in balls:\n shake(b)\n if b.hidden: count += 1\n if count == 6:\n for b in balls: b.scale = 0.2\n score += 1\n clock = 0\n \n elif clock \u003e= 360:\n info.costume_id = 1\n info.hidden = False\n \ndef seperate():\n a, b, c, d, e, f = balls\n a.move_to(600, 450)\n a.x = 600 + random() * 100\n a.y = 450 + random() * 100\n b.move_to(a)\n b.direction = random() * 360\n b.step_forward(100 * a.scale)\n c.move_to(a)\n c.direction = b.direction + 60 + random() * 120\n c.step_forward(100 * a.scale)\n d.move_to(a)\n d.direction = random() * 360\n d.step_forward(200 * a.scale)\n e.move_to(a)\n e.direction = d.direction + 30 + random() * 90\n e.step_forward(200 * a.scale)\n f.move_to(a)\n f.direction = e.direction + 30 + random() * 90\n f.step_forward(200 * a.scale)\n \ndef shake(b):\n if clock % 2 == 0:\n b.x += 5\n b.y += 5\n else:\n b.x -= 5\n b.y -= 5\n\ninfo.on('click', info_click)\nforever(loop)\n","created_at":"2024-02-16T15:01:18.557+08:00","updated_at":"2024-06-05T15:21:25.861+08:00","name":"魔球","language":"python","screenshot":{"url":"https://cdn2.koding.school/uploads/project/screenshot/695004/fdf23a051bfb901ea5317bae7359720f.jpg"},"parent_id":4,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":67,"hashid":"wdkswnvq8","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":16119238,"file_name":"ball.png","project_id":695004,"asset_id":730458,"created_at":"2024-03-25T15:50:08.159+08:00","updated_at":"2024-03-25T15:50:08.159+08:00"},{"id":16119239,"file_name":"end.png","project_id":695004,"asset_id":730459,"created_at":"2024-03-25T16:33:27.285+08:00","updated_at":"2024-03-25T16:33:27.285+08:00"},{"id":16119240,"file_name":"info.png","project_id":695004,"asset_id":730460,"created_at":"2024-03-25T16:33:27.287+08:00","updated_at":"2024-03-25T16:33:27.287+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦