{"id":957655,"student_id":58026,"content":"from game import *\n\nbg = create_sprite('bg.png') #背景\nrabbit = create_sprite('rabbit.png') #兔子\nturtle = create_sprite('turtle.png') #烏龜\n\ndef loop():\n # 烏龜或兔子超過範圍就和背景一起向左捲動\n if turtle.x \u003e 650 or rabbit.x \u003e 650:\n turtle.x -= 10\n rabbit.x -= 10\n bg.x -= 10\n if bg.x \u003c 0: bg.x += 2400 #重置背景\n \n if turtle.x \u003e rabbit.x: \n draw_text('烏龜超前', 30, 30, 'black', 40)\n if rabbit.x \u003e turtle.x: \n draw_text('兔子超前', 30, 30, 'black', 40)\n if rabbit.x == turtle.x: \n draw_text('勢均力敵', 30, 30, 'black', 40)\n\ndef turtle_move():\n turtle.x += 50\n \ndef rabbit_move():\n rabbit.x += 50\n\non('keydown', 'space', turtle_move) #空白鍵烏龜向右移動\non('keydown', 'enter', rabbit_move) #enter 鍵兔子向右移動\nforever(loop)","created_at":"2025-03-01T10:56:15.014+08:00","updated_at":"2025-03-01T11:08:57.354+08:00","name":"5_延伸_龜兔賽跑_預設版 副本","language":"python","screenshot":{"url":"https://cdn3.koding.school/uploads/project/screenshot/957655/eba87e56f6989e6722da0cedc6aee3f0.jpg"},"parent_id":829996,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":1,"hashid":"qmdsvn2m4","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":36680186,"file_name":"rabbit.png","project_id":957655,"asset_id":771779,"created_at":"2025-03-01T10:56:15.020+08:00","updated_at":"2025-03-01T10:56:15.020+08:00"},{"id":36680187,"file_name":"turtle.png","project_id":957655,"asset_id":771780,"created_at":"2025-03-01T10:56:15.021+08:00","updated_at":"2025-03-01T10:56:15.021+08:00"},{"id":36680188,"file_name":"bg.png","project_id":957655,"asset_id":771781,"created_at":"2025-03-01T10:56:15.022+08:00","updated_at":"2025-03-01T10:56:15.022+08:00"}]
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
繁中
简中
English
日本語
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦