{"id":869300,"student_id":1806,"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 rabbit.x \u003e turtle.x:\n draw_text('兔子超前!', 30, 30, 'black', 40)\n\n if rabbit.x \u003c turtle.x:\n draw_text('烏龜超前!', 30, 30, 'black', 40)\n \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":"2024-10-23T11:37:21.096+08:00","updated_at":"2024-10-23T11:42:31.973+08:00","name":"龜兔賽跑_dong","language":"python","screenshot":{"url":"https://cdn2.koding.school/uploads/project/screenshot/869300/a947b6dff01d322fdd1f039aa351e446.jpg"},"parent_id":829996,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":81,"hashid":"9ygsr9krz","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":19022441,"file_name":"rabbit.png","project_id":869300,"asset_id":771779,"created_at":"2024-10-23T11:37:21.101+08:00","updated_at":"2024-10-23T11:37:21.101+08:00"},{"id":19022442,"file_name":"turtle.png","project_id":869300,"asset_id":771780,"created_at":"2024-10-23T11:37:21.102+08:00","updated_at":"2024-10-23T11:37:21.102+08:00"},{"id":19022443,"file_name":"bg.png","project_id":869300,"asset_id":771781,"created_at":"2024-10-23T11:37:21.103+08:00","updated_at":"2024-10-23T11:37:21.103+08:00"}]
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
繁中
简中
English
日本語
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦