{"id":210527,"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號運動員\np1_rank = game.create_sprite('1.png', '2.png', '3.png') #1號運動員名次\np2_rank = game.create_sprite('1.png', '2.png', '3.png') #2號運動員名次\np3_rank = game.create_sprite('1.png', '2.png', '3.png') #3號運動員名次\n\np1.move_to(600, 350)\np2.move_to(600, 450)\np3.move_to(600, 550)\np1_rank.move_to(1200, 430)\np2_rank.move_to(1200, 540)\np3_rank.move_to(1200, 650)\n\norder = 0 #到達終點的人數\n\np1_rank.hidden = True\np2_rank.hidden = True\np3_rank.hidden = True\n\nroad.x += 1200\n\ngame.create_sound('bgm.mp3', True)\n\ndef p1_right():\n global p1_steps\n if p1.costume_id == 0:\n p1.x += 30\n p1.costume_id = 1\n\ndef p1_left():\n global p1_steps\n if p1.costume_id == 1:\n p1.x += 30\n p1.costume_id = 0\n\ndef p2_right():\n global p2_steps\n if p2.costume_id == 0:\n p2.x += 30\n p2.costume_id = 1\n\ndef p2_left():\n global p2_steps\n if p2.costume_id == 1:\n p2.x += 30\n p2.costume_id = 0\n \ndef p3_right():\n global p3_steps\n if p3.costume_id == 0:\n p3.x += 30\n p3.costume_id = 1\n\ndef p3_left():\n global p3_steps\n if p3.costume_id == 1:\n p3.x += 30\n p3.costume_id = 0\n \ndef loop():\n global order\n \n if p1.x \u003e 600 or p2.x \u003e 600 or p3.x \u003e 600:\n p1.x -= 5\n p2.x -= 5\n p3.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\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.forever(loop)\n","created_at":"2020-12-09T11:47:25.989+08:00","updated_at":"2020-12-18T15:32:37.161+08:00","name":"運動會系列 - 百米競賽 (預設版) 副本","language":"python","screenshot":{"url":"https://cdn5.koding.school/uploads/project/screenshot/210527/3afc4be65e359ca740e7c867a8312298.jpg"},"parent_id":210502,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":218,"hashid":"rdvs66kg4","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":3678581,"file_name":"bgm.mp3","project_id":210527,"asset_id":291348,"created_at":"2020-12-09T11:47:25.994+08:00","updated_at":"2020-12-09T11:47:25.994+08:00"},{"id":3678582,"file_name":"applause.wav","project_id":210527,"asset_id":291347,"created_at":"2020-12-09T11:47:25.995+08:00","updated_at":"2020-12-09T11:47:25.995+08:00"},{"id":3678583,"file_name":"y_1.png","project_id":210527,"asset_id":291346,"created_at":"2020-12-09T11:47:25.996+08:00","updated_at":"2020-12-09T11:47:25.996+08:00"},{"id":3678584,"file_name":"y_0.png","project_id":210527,"asset_id":291345,"created_at":"2020-12-09T11:47:25.997+08:00","updated_at":"2020-12-09T11:47:25.997+08:00"},{"id":3678585,"file_name":"5.png","project_id":210527,"asset_id":291344,"created_at":"2020-12-09T11:47:25.998+08:00","updated_at":"2020-12-09T11:47:25.998+08:00"},{"id":3678586,"file_name":"4.png","project_id":210527,"asset_id":291343,"created_at":"2020-12-09T11:47:25.999+08:00","updated_at":"2020-12-09T11:47:25.999+08:00"},{"id":3678587,"file_name":"3.png","project_id":210527,"asset_id":291342,"created_at":"2020-12-09T11:47:26.000+08:00","updated_at":"2020-12-09T11:47:26.000+08:00"},{"id":3678588,"file_name":"2.png","project_id":210527,"asset_id":291341,"created_at":"2020-12-09T11:47:26.001+08:00","updated_at":"2020-12-09T11:47:26.001+08:00"},{"id":3678589,"file_name":"1.png","project_id":210527,"asset_id":291340,"created_at":"2020-12-09T11:47:26.002+08:00","updated_at":"2020-12-09T11:47:26.002+08:00"},{"id":3678590,"file_name":"r_1.png","project_id":210527,"asset_id":291339,"created_at":"2020-12-09T11:47:26.003+08:00","updated_at":"2020-12-09T11:47:26.003+08:00"},{"id":3678591,"file_name":"r_0.png","project_id":210527,"asset_id":291338,"created_at":"2020-12-09T11:47:26.004+08:00","updated_at":"2020-12-09T11:47:26.004+08:00"},{"id":3678592,"file_name":"p_1.png","project_id":210527,"asset_id":291337,"created_at":"2020-12-09T11:47:26.004+08:00","updated_at":"2020-12-09T11:47:26.004+08:00"},{"id":3678593,"file_name":"p_0.png","project_id":210527,"asset_id":291336,"created_at":"2020-12-09T11:47:26.005+08:00","updated_at":"2020-12-09T11:47:26.005+08:00"},{"id":3678594,"file_name":"g_1.png","project_id":210527,"asset_id":291335,"created_at":"2020-12-09T11:47:26.006+08:00","updated_at":"2020-12-09T11:47:26.006+08:00"},{"id":3678595,"file_name":"g_0.png","project_id":210527,"asset_id":291334,"created_at":"2020-12-09T11:47:26.007+08:00","updated_at":"2020-12-09T11:47:26.007+08:00"},{"id":3678596,"file_name":"road.jpg","project_id":210527,"asset_id":291333,"created_at":"2020-12-09T11:47:26.008+08:00","updated_at":"2020-12-09T11:47:26.008+08:00"},{"id":3678597,"file_name":"b_1.png","project_id":210527,"asset_id":291332,"created_at":"2020-12-09T11:47:26.009+08:00","updated_at":"2020-12-09T11:47:26.009+08:00"},{"id":3678598,"file_name":"b_0.png","project_id":210527,"asset_id":291331,"created_at":"2020-12-09T11:47:26.010+08:00","updated_at":"2020-12-09T11:47:26.010+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦