{"id":772143,"student_id":10,"content":"from game import *\nfrom random import *\n\nplayer = create_sprite('player.png')\nplayer.y = 700\narr = []\nclock = 0\nscore = 0\n\ndef loop():\n global clock, score\n if key.right: player.x += 5\n if key.left: player.x -= 5\n \n clock += 1\n if clock % 60 == 0:\n a = create_sprite('apple.png', 'mushoom.png')\n a.costume_id = randrange(2)\n a.x = random() * 1000 + 100\n a.y = -200\n a.combo = 0\n arr.append(a)\n \n for s in arr:\n \n if s.touched(player) and abs(s.x - (player.x + 50)) \u003c 20:\n s.layer = -1\n if s.touched(player) and abs(s.x - (player.x - 50)) \u003c 20:\n s.vy = -10\n s.combo += 1\n if s.layer == -1:\n s.x = player.x\n if s.y \u003e player.y and not s.hidden:\n s.hidden = True\n score += 1\n score += s.combo\n \n if s.combo \u003e 0:\n s.y += s.vy\n s.vy += 0.2\n else:\n s.y += 5\n \n if len(arr) \u003e 0 and arr[0].y \u003e 900:\n arr[0].destroy()\n arr.pop(0)\n \n draw_text(score, 10, 10, 'black', 30)\n\nforever(loop)","created_at":"2024-06-20T18:32:48.322+08:00","updated_at":"2024-06-20T18:50:15.717+08:00","name":"採收蘋果","language":"python","screenshot":{"url":"https://cdn0.koding.school/uploads/project/screenshot/772143/3a6f6cef7e04a012f942303dc23a4b03.jpg"},"parent_id":4,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":39,"hashid":"36ysy6rqp","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":17214923,"file_name":"player.png","project_id":772143,"asset_id":748977,"created_at":"2024-06-20T18:33:19.650+08:00","updated_at":"2024-06-20T18:33:19.650+08:00"},{"id":17214924,"file_name":"mushoom.png","project_id":772143,"asset_id":748978,"created_at":"2024-06-20T18:35:44.671+08:00","updated_at":"2024-06-20T18:35:44.671+08:00"},{"id":17214925,"file_name":"apple.png","project_id":772143,"asset_id":748979,"created_at":"2024-06-20T18:35:44.673+08:00","updated_at":"2024-06-20T18:35:44.673+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦