{"id":694869,"student_id":10,"content":"from game import *\nfrom random import randint\n\nset_backdrop('black')\n\nscore = 0\napples = []\nclock = 0\n\nplayer = create_sprite('koding.png')\nplayer.y = 800\n\nbucket = create_sprite('koding.png')\nbucket.y = 700\nbucket.x += 50\n\ndef gameloop():\n global clock, score\n clock += 1\n \n if clock % 120 == 0:\n s = create_sprite('cloud.png')\n s.x = randint(100, 1100)\n s.y = -100\n s.vx = 0\n s.vy = 0\n s.scale = 0.3\n s.combo = 0\n apples.append(s)\n \n for a in apples:\n a.y += a.vy\n a.x += a.vx\n \n if a.vy \u003e 10: a.vy = 10\n \n if a.touched(player) and abs(a.x - player.x) \u003c 10:\n a.vx = a.x - player.x\n a.vy = -a.vy\n a.combo += 1\n \n if a.touched(bucket) and abs(a.x - player.x) \u003c 10:\n score += a.combo\n a.destory()\n \n a.vy += 0.2\n \n \n if key.left:\n player.x -= 10\n bucket.x -= 10\n if key.right:\n player.x += 10\n bucket.x += 10\n\nforever(gameloop)","created_at":"2024-02-14T22:42:13.687+08:00","updated_at":"2024-02-15T11:14:19.533+08:00","name":"接蘋果","language":"python","screenshot":{"url":"https://cdn5.koding.school/uploads/project/screenshot/694869/14bf3b184523ef1b7c02f90b4b568ec7.jpg"},"parent_id":4,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":56,"hashid":"p93sryd6d","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":15565432,"file_name":"cloud.png","project_id":694869,"asset_id":302343,"created_at":"2024-02-14T22:42:13.695+08:00","updated_at":"2024-02-14T22:42:13.695+08:00"},{"id":15565433,"file_name":"bg.jpg","project_id":694869,"asset_id":302344,"created_at":"2024-02-14T22:42:13.703+08:00","updated_at":"2024-02-14T22:42:13.703+08:00"},{"id":15565434,"file_name":"calm.mp3","project_id":694869,"asset_id":302345,"created_at":"2024-02-14T22:42:13.705+08:00","updated_at":"2024-02-14T22:42:13.705+08:00"},{"id":15565435,"file_name":"koding.png","project_id":694869,"asset_id":302346,"created_at":"2024-02-14T22:42:13.706+08:00","updated_at":"2024-02-14T22:42:13.706+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦