{"id":829664,"student_id":10,"content":"from game import *\n\nset_backdrop('bg.png')\n\nclass Car():\n def __init__(self, img, power):\n self.sprite = create_sprite(img)\n self.power = power\n self.speed = 0\n forever(self.loop)\n \n def loop(self):\n self.sprite.step_forward(self.speed)\n self.speed *= 0.99\n \n def speedup(self):\n self.speed += self.power\n \n def turn(self, value):\n self.sprite.direction += value\n self.speed *= 0.99\n \ncar1 = Car('black.png', 0.05)\n\ndef loop():\n if key.right: car1.turn(2) #右轉\n if key.left: car1.turn(-2) #左轉\n if key.up: car1.speedup() #加速\n\nforever(loop)","created_at":"2024-08-27T16:33:13.178+08:00","updated_at":"2024-08-29T12:32:32.483+08:00","name":"小賽車_預設版","language":"python","screenshot":{"url":"https://cdn2.koding.school/uploads/project/screenshot/829664/0a0316949574eb28856179ada308e03c.jpg"},"parent_id":4,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":33,"hashid":"yeys45ny9","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":18263403,"file_name":"yellow.png","project_id":829664,"asset_id":771321,"created_at":"2024-08-28T12:49:12.690+08:00","updated_at":"2024-08-28T12:49:12.690+08:00"},{"id":18263401,"file_name":"green.png","project_id":829664,"asset_id":771319,"created_at":"2024-08-28T12:49:12.312+08:00","updated_at":"2024-08-28T12:49:12.312+08:00"},{"id":18263402,"file_name":"red.png","project_id":829664,"asset_id":771320,"created_at":"2024-08-28T12:49:12.314+08:00","updated_at":"2024-08-28T12:49:12.314+08:00"},{"id":18263399,"file_name":"black.png","project_id":829664,"asset_id":771317,"created_at":"2024-08-28T12:49:11.909+08:00","updated_at":"2024-08-28T12:49:11.909+08:00"},{"id":18263400,"file_name":"blue.png","project_id":829664,"asset_id":771318,"created_at":"2024-08-28T12:49:11.911+08:00","updated_at":"2024-08-28T12:49:11.911+08:00"},{"id":18263398,"file_name":"bg.png","project_id":829664,"asset_id":771316,"created_at":"2024-08-28T12:47:35.272+08:00","updated_at":"2024-08-28T12:47:35.272+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦