{"id":252488,"student_id":10,"content":"import game\n\nroad = game.create_sprite('road.jpg') #道路\np1 = game.create_sprite('r_0.png', 'r_1.png') #1號運動員\np2 = game.create_sprite('g_0.png', 'g_1.png') #2號運動員\np3 = game.create_sprite('b_0.png', 'b_1.png') #3號運動員\np4 = game.create_sprite('y_0.png', 'y_1.png') #3號運動員\np1_rank = game.create_sprite('1.png', '2.png', '3.png', '4.png') #1號運動員名次\np2_rank = game.create_sprite('1.png', '2.png', '3.png', '4.png') #2號運動員名次\np3_rank = game.create_sprite('1.png', '2.png', '3.png', '4.png') #3號運動員名次\np4_rank = game.create_sprite('1.png', '2.png', '3.png', '4.png') #3號運動員名次\n\np1.move_to(600, 340)\np2.move_to(600, 450)\np3.move_to(600, 560)\np4.move_to(600, 670)\np1_rank.move_to(1200, 430)\np2_rank.move_to(1200, 540)\np3_rank.move_to(1200, 650)\np4_rank.move_to(1200, 760)\n\np1_rank.hidden = True\np2_rank.hidden = True\np3_rank.hidden = True\np4_rank.hidden = True\n\nroad.x += 1200\norder = 0 #到達終點的人數\n\n#game.create_sound('bgm.mp3', True)\n\ndef p1_right():\n if p1.costume_id == 0:\n p1.costume_id = 1\n p1.x += 30\n\ndef p1_left():\n if p1.costume_id == 1:\n p1.costume_id = 0\n p1.x += 30\n\ndef p2_right():\n if p2.costume_id == 0:\n p2.costume_id = 1\n p2.x += 30\n\ndef p2_left():\n if p2.costume_id == 1:\n p2.costume_id = 0\n p2.x += 30\n \ndef p3_right():\n if p3.costume_id == 0:\n p3.costume_id = 1\n p3.x += 30\n\ndef p3_left():\n if p3.costume_id == 1:\n p3.costume_id = 0\n p3.x += 30\n\ndef p4_right():\n if p4.costume_id == 0:\n p4.costume_id = 1\n p4.x += 30\n\ndef p4_left():\n if p4.costume_id == 1:\n p4.costume_id = 0\n p4.x += 30\n \ndef loop():\n global order\n \n # # 使跑最前的玩家不超過遊戲場景中間\n if p1.x \u003e 600 or p2.x \u003e 600 or p3.x \u003e 600 or p4.x \u003e 600:\n p1.x -= 5\n p2.x -= 5\n p3.x -= 5\n p4.x -= 5\n road.x -= 5\n \n if p1.x - road.x \u003e 1000 and p1_rank.hidden:\n p1_rank.hidden = False\n p1_rank.costume_id = order\n order += 1\n game.create_sound('applause.wav')\n \n if p2.x - road.x \u003e 1000 and p2_rank.hidden:\n p2_rank.hidden = False\n p2_rank.costume_id = order\n order += 1\n game.create_sound('applause.wav')\n \n if p3.x - road.x \u003e 1000 and p3_rank.hidden:\n p3_rank.hidden = False\n p3_rank.costume_id = order\n order += 1\n game.create_sound('applause.wav')\n \n if p4.x - road.x \u003e 1000 and p4_rank.hidden:\n p4_rank.hidden = False\n p4_rank.costume_id = order\n order += 1\n game.create_sound('applause.wav')\n\ngame.on('keydown', 'q', p1_right)\ngame.on('keydown', 'w', p1_left)\ngame.on('keydown', 'v', p2_right)\ngame.on('keydown', 'b', p2_left)\ngame.on('keydown', 'o', p3_right)\ngame.on('keydown', 'p', p3_left)\ngame.on('keydown', 'right', p4_right)\ngame.on('keydown', 'left', p4_left)\n\ngame.forever(loop)\n","created_at":"2021-05-13T15:21:33.791+08:00","updated_at":"2021-05-13T15:57:25.463+08:00","name":"運動會系列 - 短跑競賽_延伸挑戰練習 副本","language":"python","screenshot":{"url":"https://cdn4.koding.school/uploads/project/screenshot/252488/598788260dffaf7cc34f1a2702d0e606.jpg"},"parent_id":252421,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":196,"hashid":"882sqde2e","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":4778447,"file_name":"b_0.png","project_id":252488,"asset_id":284915,"created_at":"2021-05-13T15:21:33.798+08:00","updated_at":"2021-05-13T15:21:33.798+08:00"},{"id":4778448,"file_name":"b_1.png","project_id":252488,"asset_id":284916,"created_at":"2021-05-13T15:21:33.799+08:00","updated_at":"2021-05-13T15:21:33.799+08:00"},{"id":4778449,"file_name":"road.jpg","project_id":252488,"asset_id":284934,"created_at":"2021-05-13T15:21:33.800+08:00","updated_at":"2021-05-13T15:21:33.800+08:00"},{"id":4778450,"file_name":"g_0.png","project_id":252488,"asset_id":284935,"created_at":"2021-05-13T15:21:33.801+08:00","updated_at":"2021-05-13T15:21:33.801+08:00"},{"id":4778451,"file_name":"g_1.png","project_id":252488,"asset_id":284936,"created_at":"2021-05-13T15:21:33.803+08:00","updated_at":"2021-05-13T15:21:33.803+08:00"},{"id":4778452,"file_name":"p_0.png","project_id":252488,"asset_id":284937,"created_at":"2021-05-13T15:21:33.804+08:00","updated_at":"2021-05-13T15:21:33.804+08:00"},{"id":4778453,"file_name":"p_1.png","project_id":252488,"asset_id":284938,"created_at":"2021-05-13T15:21:33.805+08:00","updated_at":"2021-05-13T15:21:33.805+08:00"},{"id":4778454,"file_name":"r_0.png","project_id":252488,"asset_id":284939,"created_at":"2021-05-13T15:21:33.806+08:00","updated_at":"2021-05-13T15:21:33.806+08:00"},{"id":4778455,"file_name":"r_1.png","project_id":252488,"asset_id":284940,"created_at":"2021-05-13T15:21:33.807+08:00","updated_at":"2021-05-13T15:21:33.807+08:00"},{"id":4778456,"file_name":"1.png","project_id":252488,"asset_id":284941,"created_at":"2021-05-13T15:21:33.808+08:00","updated_at":"2021-05-13T15:21:33.808+08:00"},{"id":4778457,"file_name":"2.png","project_id":252488,"asset_id":284942,"created_at":"2021-05-13T15:21:33.809+08:00","updated_at":"2021-05-13T15:21:33.809+08:00"},{"id":4778458,"file_name":"3.png","project_id":252488,"asset_id":284943,"created_at":"2021-05-13T15:21:33.810+08:00","updated_at":"2021-05-13T15:21:33.810+08:00"},{"id":4778459,"file_name":"4.png","project_id":252488,"asset_id":284944,"created_at":"2021-05-13T15:21:33.816+08:00","updated_at":"2021-05-13T15:21:33.816+08:00"},{"id":4778460,"file_name":"5.png","project_id":252488,"asset_id":284945,"created_at":"2021-05-13T15:21:33.817+08:00","updated_at":"2021-05-13T15:21:33.817+08:00"},{"id":4778461,"file_name":"y_0.png","project_id":252488,"asset_id":284919,"created_at":"2021-05-13T15:21:33.818+08:00","updated_at":"2021-05-13T15:21:33.818+08:00"},{"id":4778462,"file_name":"y_1.png","project_id":252488,"asset_id":284920,"created_at":"2021-05-13T15:21:33.819+08:00","updated_at":"2021-05-13T15:21:33.819+08:00"},{"id":4778463,"file_name":"applause.wav","project_id":252488,"asset_id":284957,"created_at":"2021-05-13T15:21:33.820+08:00","updated_at":"2021-05-13T15:21:33.820+08:00"},{"id":4778464,"file_name":"bgm.mp3","project_id":252488,"asset_id":284958,"created_at":"2021-05-13T15:21:33.821+08:00","updated_at":"2021-05-13T15:21:33.821+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦