{"id":765916,"student_id":10,"content":"from game import *\nfrom random import *\n\nspace = 300\nspeed = 3\narr = []\n\nplayer = create_sprite('a_0.png', 'k_0.png')\nplayer.x = 100\n\nfor i in range(10):\n s = create_sprite('a_0.png', 'k_0.png', 'a_1.png', 'k_1.png')\n s.x = space * i + 1200\n s.y = random() * 900\n s.active = False\n s.costume_id = randrange(2)\n arr.append(s)\n \ndef loop():\n if key.right: player.costume_id = 1\n if key.left: player.costume_id = 0\n for s in arr: update_kd(s)\n\ndef update_kd(s):\n s.x -= speed\n if s.active: s.x -= speed\n \n if s.x \u003c 1200 and s.x \u003e 0:\n s.y -= speed * (s.y - 450) / (s.x - 0)\n \n if s.x \u003c 0:\n s.direction = 90\n s.x += space * 10 + random() * 150\n s.y = random() * 900\n s.costume_id = randrange(2)\n s.active = random() \u003c 0.1\n if s.active: s.x *= 2\n \n if s.x \u003c 100 and s.direction == 90:\n if s.costume_id == 0 and player.costume_id == 0:\n s.direction = 80\n elif s.costume_id == 1 and player.costume_id == 1:\n s.direction = 80\n else:\n stop()\n\nforever(loop)","created_at":"2024-06-06T11:05:58.499+08:00","updated_at":"2024-06-12T11:02:17.451+08:00","name":"發氣球","language":"python","screenshot":{"url":"https://cdn2.koding.school/uploads/project/screenshot/765916/d7f72eb85f77b49e3fb4f79f33aa33bb.jpg"},"parent_id":4,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":51,"hashid":"d5msn5pe9","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":17096514,"file_name":"k_0.png","project_id":765916,"asset_id":746704,"created_at":"2024-06-06T11:09:23.270+08:00","updated_at":"2024-06-06T11:09:23.270+08:00"},{"id":17096515,"file_name":"k_1.png","project_id":765916,"asset_id":746705,"created_at":"2024-06-06T11:09:23.272+08:00","updated_at":"2024-06-06T11:09:23.272+08:00"},{"id":17096512,"file_name":"a_0.png","project_id":765916,"asset_id":746702,"created_at":"2024-06-06T11:09:22.692+08:00","updated_at":"2024-06-06T11:09:22.692+08:00"},{"id":17096513,"file_name":"a_1.png","project_id":765916,"asset_id":746703,"created_at":"2024-06-06T11:09:22.694+08:00","updated_at":"2024-06-06T11:09:22.694+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦