{"id":842653,"student_id":3760,"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 turtle.x \u003c rabbit.x:\n draw_text('兔子超前!', 30, 30, 'black', 40)\n if turtle.x == rabbit.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":"2024-09-20T18:39:58.393+08:00","updated_at":"2024-09-20T18:49:56.311+08:00","name":"5_延伸_龜兔賽跑_預設版 副本","language":"python","screenshot":{"url":"https://cdn3.koding.school/uploads/project/screenshot/842653/26961db4fc8b60fd2be83bd2da564423.jpg"},"parent_id":829996,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":60,"hashid":"9ygsrd4yg","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":18505712,"file_name":"rabbit.png","project_id":842653,"asset_id":771779,"created_at":"2024-09-20T18:39:58.398+08:00","updated_at":"2024-09-20T18:39:58.398+08:00"},{"id":18505713,"file_name":"turtle.png","project_id":842653,"asset_id":771780,"created_at":"2024-09-20T18:39:58.399+08:00","updated_at":"2024-09-20T18:39:58.399+08:00"},{"id":18505714,"file_name":"bg.png","project_id":842653,"asset_id":771781,"created_at":"2024-09-20T18:39:58.400+08:00","updated_at":"2024-09-20T18:39:58.400+08:00"}]
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
繁中
简中
English
日本語
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦