{"id":767068,"student_id":10,"content":"from game import *\nfrom random import *\n\nset_backdrop('bg.png')\nplayer = create_sprite('p_0.png', 'p__1.png', 'p_2.png', 'p_0.png', 'p_3.png', 'p_4.png')\nballoons = create_sprite('balloons.png')\narr = []\nspace = 300\nspeed = 3\nscore = 0\nclock = 0\n\nfor i in range(5):\n s = create_sprite(\n 'k_0.png', 'k_1.png', 'k_2.png', 'k_3.png',\n 'k_4.png', 'k_5.png', 'k_6.png', 'k_7.png'\n )\n s.x = space * i + 1200\n s.y = random() * 900\n s.scale = 0.8\n s.costume_id = randrange(2) * 4\n arr.append(s)\n \ndef loop():\n global clock\n if player.costume_id \u003c= 2:\n clock += 1\n if key.right: player.costume_id = 1\n if key.left: player.costume_id = 2\n for s in arr: update_kd(s)\n else:\n balloons.y -= 3\n draw_text('得分:' + str(score), 1000, 100, 'black', 50)\n\ndef update_kd(s):\n s.x -= speed\n if s.x \u003e 0: s.y -= speed * (s.y - 450) / (s.x - 0)\n \n if s.x \u003c 0:\n s.x += space * 5 + random() * 150\n s.y = random() * 900\n s.costume_id = randrange(2) * 4\n \n if clock % 30 == 0:\n if s.costume_id % 2 == 0:\n s.costume_id += 1\n else:\n s.costume_id -= 1\n \n if s.x \u003c 400 and s.costume_id % 4 \u003c 2:\n if (s.costume_id == 0 or s.costume_id == 1) and player.costume_id == 1:\n s.costume_id += 2\n player.costume_id = 0\n score += 1\n elif (s.costume_id == 4 or s.costume_id == 5) and player.costume_id == 2:\n s.costume_id += 2\n player.costume_id = 0\n score += 1\n else:\n player.costume_id += 3\n\nforever(loop)\n","created_at":"2024-06-13T18:47:00.946+08:00","updated_at":"2024-06-14T10:50:50.586+08:00","name":"發氣球","language":"python","screenshot":{"url":"https://cdn7.koding.school/uploads/project/screenshot/767068/78f3bb562936848ee6485faa90cfa755.jpg"},"parent_id":4,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":42,"hashid":"qmdswnq28","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":17118996,"file_name":"k_5.png","project_id":767068,"asset_id":747420,"created_at":"2024-06-13T18:47:14.536+08:00","updated_at":"2024-06-13T18:47:14.536+08:00"},{"id":17118997,"file_name":"k_7.png","project_id":767068,"asset_id":747421,"created_at":"2024-06-13T18:47:14.539+08:00","updated_at":"2024-06-13T18:47:14.539+08:00"},{"id":17119000,"file_name":"k_1.png","project_id":767068,"asset_id":747424,"created_at":"2024-06-13T18:47:15.791+08:00","updated_at":"2024-06-13T18:47:15.791+08:00"},{"id":17119001,"file_name":"k_0.png","project_id":767068,"asset_id":747425,"created_at":"2024-06-13T18:47:15.793+08:00","updated_at":"2024-06-13T18:47:15.793+08:00"},{"id":17118998,"file_name":"k_3.png","project_id":767068,"asset_id":747422,"created_at":"2024-06-13T18:47:15.252+08:00","updated_at":"2024-06-13T18:47:15.252+08:00"},{"id":17118999,"file_name":"k_2.png","project_id":767068,"asset_id":747423,"created_at":"2024-06-13T18:47:15.254+08:00","updated_at":"2024-06-13T18:47:15.254+08:00"},{"id":17119002,"file_name":"p_3.png","project_id":767068,"asset_id":747426,"created_at":"2024-06-13T18:47:16.495+08:00","updated_at":"2024-06-13T18:47:16.495+08:00"},{"id":17119003,"file_name":"p_4.png","project_id":767068,"asset_id":747427,"created_at":"2024-06-13T18:47:16.498+08:00","updated_at":"2024-06-13T18:47:16.498+08:00"},{"id":17118994,"file_name":"k_4.png","project_id":767068,"asset_id":747418,"created_at":"2024-06-13T18:47:13.994+08:00","updated_at":"2024-06-13T18:47:13.994+08:00"},{"id":17118995,"file_name":"k_6.png","project_id":767068,"asset_id":747419,"created_at":"2024-06-13T18:47:13.996+08:00","updated_at":"2024-06-13T18:47:13.996+08:00"},{"id":17119006,"file_name":"p_0.png","project_id":767068,"asset_id":747430,"created_at":"2024-06-13T18:47:19.531+08:00","updated_at":"2024-06-13T18:47:19.531+08:00"},{"id":17119007,"file_name":"bg.png","project_id":767068,"asset_id":747431,"created_at":"2024-06-13T18:47:19.533+08:00","updated_at":"2024-06-13T18:47:19.533+08:00"},{"id":17119004,"file_name":"balloons.png","project_id":767068,"asset_id":747428,"created_at":"2024-06-13T18:47:17.336+08:00","updated_at":"2024-06-13T18:47:17.336+08:00"},{"id":17119005,"file_name":"p_2.png","project_id":767068,"asset_id":747429,"created_at":"2024-06-13T18:47:17.338+08:00","updated_at":"2024-06-13T18:47:17.338+08:00"},{"id":17119009,"file_name":"p__1.png","project_id":767068,"asset_id":747432,"created_at":"2024-06-13T18:50:06.719+08:00","updated_at":"2024-06-13T18:50:51.309+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦