{"id":765673,"student_id":10,"content":"from game import *\nfrom random import *\n\nset_backdrop('bg.png')\npitcher = create_sprite('k_0.png', 'k_1.png', 'k_2.png', 'k_3.png')\nb1 = create_sprite('ball.png')\nb2 = create_sprite('ball.png')\nb3 = create_sprite('ball.png')\nb4 = create_sprite('ball.png')\nb5 = create_sprite('ball.png')\nb6 = create_sprite('ball.png')\nplayer = create_sprite('p_0.png', 'p_1.png', 'p_2.png', 'p_3.png', 'p_4.png', 'p_5.png')\n\nlevel = 0\nclock = 0\n\ndef loop():\n global clock\n \n count = 6\n if b1.hidden: count -= 1\n if b2.hidden: count -= 1\n if b3.hidden: count -= 1\n if b4.hidden: count -= 1\n if b5.hidden: count -= 1\n if b6.hidden: count -= 1\n if count == 0: next_level()\n \n clock += 1\n if clock == 10: pitcher.costume_id = 1\n if clock == 20: pitcher.costume_id = 2\n if clock == 30: pitcher.costume_id = 3\n if clock \u003e 30 and clock \u003c 90: seperate()\n if clock == 100: player.costume_id = 1\n if clock == 110: player.costume_id = 2\n if clock == 120: player.costume_id = 3\n if clock == 130: player.costume_id = 4\n if clock == 140: player.costume_id = 5\n \n draw_text('level:' + str(level), 30, 30)\n draw_text('count:' + str(count), 30, 60)\n\ndef next_level():\n global clock, level\n clock = 0\n level += 1\n b1.hidden = level \u003c= 0\n b2.hidden = level \u003c= 3\n b3.hidden = level \u003c= 6\n b4.hidden = level \u003c= 9\n b5.hidden = level \u003c= 12\n b6.hidden = level \u003c= 15\n b1.scale = 0.5\n b2.scale = b3.scale = b4.scale = b5.scale = b6.scale = b1.scale\n player.costume_id = 0\n pitcher.costume_id = 0\n\ndef seperate():\n b1.x = 600 + random() * 100 * b1.scale - 50 * b1.scale\n b1.y = 450 + random() * 100 * b1.scale - 50 * b1.scale\n b2.move_to(b1)\n b2.direction = random() * 360\n b2.step_forward(100 * b1.scale)\n b3.move_to(b1)\n b3.direction = b2.direction + random() * 180\n b3.step_forward(100 * b1.scale)\n b4.move_to(b1)\n b4.direction = random() * 360\n b4.step_forward(200 * b1.scale)\n b5.move_to(b1)\n b5.direction = b4.direction + random() * 120\n b5.step_forward(200 * b1.scale)\n b6.move_to(b1)\n b6.direction = b5.direction + random() * 120\n b6.step_forward(200 * b1.scale)\n b1.scale += 0.01\n b2.scale = b3.scale = b4.scale = b5.scale = b6.scale = b1.scale\n\ndef click():\n if b1.touched(cursor): b1.hidden = True\n elif b2.touched(cursor): b2.hidden = True\n elif b3.touched(cursor): b3.hidden = True\n elif b4.touched(cursor): b4.hidden = True\n elif b5.touched(cursor): b5.hidden = True\n elif b6.touched(cursor): b6.hidden = True\n else: stop()\n\non('click', click)\nforever(loop)\n\nnext_level()\n","created_at":"2024-06-05T15:45:14.504+08:00","updated_at":"2024-06-05T18:25:11.225+08:00","name":"魔球2","language":"python","screenshot":{"url":"https://cdn7.koding.school/uploads/project/screenshot/765673/64fb24cc4285ae76cbad588a9635871c.jpg"},"parent_id":4,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":43,"hashid":"zpesz9p82","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":17090974,"file_name":"p_5.png","project_id":765673,"asset_id":746662,"created_at":"2024-06-05T18:01:56.761+08:00","updated_at":"2024-06-05T18:01:56.761+08:00"},{"id":17090975,"file_name":"p_4.png","project_id":765673,"asset_id":746663,"created_at":"2024-06-05T18:01:56.763+08:00","updated_at":"2024-06-05T18:01:56.763+08:00"},{"id":17090982,"file_name":"k_1.png","project_id":765673,"asset_id":746670,"created_at":"2024-06-05T18:06:20.514+08:00","updated_at":"2024-06-05T18:06:20.514+08:00"},{"id":17090983,"file_name":"k_0.png","project_id":765673,"asset_id":746671,"created_at":"2024-06-05T18:06:20.516+08:00","updated_at":"2024-06-05T18:06:20.516+08:00"},{"id":17090978,"file_name":"p_1.png","project_id":765673,"asset_id":746666,"created_at":"2024-06-05T18:01:58.712+08:00","updated_at":"2024-06-05T18:01:58.712+08:00"},{"id":17090979,"file_name":"p_0.png","project_id":765673,"asset_id":746667,"created_at":"2024-06-05T18:01:58.713+08:00","updated_at":"2024-06-05T18:01:58.713+08:00"},{"id":17090980,"file_name":"k_3.png","project_id":765673,"asset_id":746668,"created_at":"2024-06-05T18:06:19.996+08:00","updated_at":"2024-06-05T18:06:19.996+08:00"},{"id":17090981,"file_name":"k_2.png","project_id":765673,"asset_id":746669,"created_at":"2024-06-05T18:06:19.997+08:00","updated_at":"2024-06-05T18:06:19.997+08:00"},{"id":17090984,"file_name":"bg.png","project_id":765673,"asset_id":746672,"created_at":"2024-06-05T18:09:57.762+08:00","updated_at":"2024-06-05T18:09:57.762+08:00"},{"id":17090976,"file_name":"p_3.png","project_id":765673,"asset_id":746664,"created_at":"2024-06-05T18:01:58.036+08:00","updated_at":"2024-06-05T18:01:58.036+08:00"},{"id":17090977,"file_name":"p_2.png","project_id":765673,"asset_id":746665,"created_at":"2024-06-05T18:01:58.037+08:00","updated_at":"2024-06-05T18:01:58.037+08:00"},{"id":17090920,"file_name":"ball.png","project_id":765673,"asset_id":730458,"created_at":"2024-06-05T15:45:39.264+08:00","updated_at":"2024-06-05T15:45:39.264+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦