{"id":194719,"student_id":10,"content":"import game\n\nroad = game.create_sprite('road.jpg')\np1 = game.create_sprite('r_0.png', 'r_1.png')\np2 = game.create_sprite('g_0.png', 'g_1.png')\np3 = game.create_sprite('b_0.png', 'b_1.png')\np4 = game.create_sprite('y_0.png', 'y_1.png')\np1_rank = game.create_sprite('1.png', '2.png', '3.png')\np2_rank = game.create_sprite('1.png', '2.png', '3.png')\np3_rank = game.create_sprite('1.png', '2.png', '3.png')\np4_rank = game.create_sprite('1.png', '2.png', '3.png')\n\np1.move_to(600, 350)\np2.move_to(600, 450)\np3.move_to(600, 550)\np4.move_to(600, 650)\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 = p2_rank.hidden = p3_rank.hidden = p4_rank.hidden = True\n\np1_steps = 0\np2_steps = 0\np3_steps = 0\np4_steps = 0\nrank = 0\n\ngame.create_sound('bgm.mp3', True)\n\ndef p1_right():\n global p1_steps\n if p1.costume_id == 0:\n p1.costume_id = 1\n p1_steps += 30\n\ndef p1_left():\n global p1_steps\n if p1.costume_id == 1:\n p1.costume_id = 0\n p1_steps += 30\n\ndef p2_right():\n global p2_steps\n if p2.costume_id == 0:\n p2.costume_id = 1\n p2_steps += 30\n\ndef p2_left():\n global p2_steps\n if p2.costume_id == 1:\n p2.costume_id = 0\n p2_steps += 30\n \ndef p3_right():\n global p3_steps\n if p3.costume_id == 0:\n p3.costume_id = 1\n p3_steps += 30\n\ndef p3_left():\n global p3_steps\n if p3.costume_id == 1:\n p3.costume_id = 0\n p3_steps += 30\n\ndef p4_right():\n global p4_steps\n if p4.costume_id == 0:\n p4.costume_id = 1\n p4_steps += 30\n\ndef p4_left():\n global p4_steps\n if p4.costume_id == 1:\n p4.costume_id = 0\n p4_steps += 30\n \ndef loop():\n global rank\n offset = max(p1_steps, p2_steps, p3_steps, p4_steps)\n road.x = 1600 - offset\n p1.x = 600 - offset + p1_steps\n p2.x = 600 - offset + p2_steps\n p3.x = 600 - offset + p3_steps\n p4.x = 600 - offset + p4_steps\n \n if p1_steps \u003e 2000 and p1_rank.hidden:\n p1_rank.hidden = False\n p1_rank.costume_id = rank\n rank += 1\n game.create_sound('applause.wav')\n \n if p2_steps \u003e 2000 and p2_rank.hidden:\n p2_rank.hidden = False\n p2_rank.costume_id = rank\n rank += 1\n game.create_sound('applause.wav')\n \n if p3_steps \u003e 2000 and p3_rank.hidden:\n p3_rank.hidden = False\n p3_rank.costume_id = rank\n rank += 1\n game.create_sound('applause.wav')\n \n if p4_steps \u003e 2000 and p4_rank.hidden:\n p4_rank.hidden = False\n p4_rank.costume_id = rank\n rank += 1\n game.create_sound('applause.wav')\n\ngame.on('keydown', 'z', p1_right)\ngame.on('keydown', 'x', p1_left)\ngame.on('keydown', 'n', p2_right)\ngame.on('keydown', 'm', p2_left)\ngame.on('keydown', 'right', p3_right)\ngame.on('keydown', 'left', p3_left)\ngame.on('keydown', 'v', p4_right)\ngame.on('keydown', 'b', p4_left)\ngame.forever(loop)\n","created_at":"2020-10-13T10:59:08.002+08:00","updated_at":"2024-01-15T08:31:39.546+08:00","name":"運動會系列 - 百米競賽","language":"python","screenshot":{"url":"https://cdn7.koding.school/uploads/project/screenshot/194719/28c7964a0f5e1a29ee3a1f193b35ff4b.jpg"},"parent_id":4,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":246,"hashid":"yeysvzz3r","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":3590597,"file_name":"y_0.png","project_id":194719,"asset_id":284919,"created_at":"2020-11-25T17:21:39.628+08:00","updated_at":"2020-11-25T17:21:39.628+08:00"},{"id":3590598,"file_name":"y_1.png","project_id":194719,"asset_id":284920,"created_at":"2020-11-25T17:21:39.630+08:00","updated_at":"2020-11-25T17:21:39.630+08:00"},{"id":3590615,"file_name":"applause.wav","project_id":194719,"asset_id":284957,"created_at":"2020-11-25T17:48:11.239+08:00","updated_at":"2020-11-25T17:48:11.239+08:00"},{"id":3590616,"file_name":"bgm.mp3","project_id":194719,"asset_id":284958,"created_at":"2020-11-25T17:48:11.241+08:00","updated_at":"2020-11-25T17:48:11.241+08:00"},{"id":3590593,"file_name":"2.png","project_id":194719,"asset_id":284942,"created_at":"2020-11-25T17:21:38.681+08:00","updated_at":"2020-11-25T17:21:38.681+08:00"},{"id":3590594,"file_name":"3.png","project_id":194719,"asset_id":284943,"created_at":"2020-11-25T17:21:38.683+08:00","updated_at":"2020-11-25T17:21:38.683+08:00"},{"id":3590595,"file_name":"4.png","project_id":194719,"asset_id":284944,"created_at":"2020-11-25T17:21:39.142+08:00","updated_at":"2020-11-25T17:21:39.142+08:00"},{"id":3590596,"file_name":"5.png","project_id":194719,"asset_id":284945,"created_at":"2020-11-25T17:21:39.143+08:00","updated_at":"2020-11-25T17:21:39.143+08:00"},{"id":3590587,"file_name":"g_1.png","project_id":194719,"asset_id":284936,"created_at":"2020-11-25T17:21:37.030+08:00","updated_at":"2020-11-25T17:21:37.030+08:00"},{"id":3590588,"file_name":"p_0.png","project_id":194719,"asset_id":284937,"created_at":"2020-11-25T17:21:37.032+08:00","updated_at":"2020-11-25T17:21:37.032+08:00"},{"id":3590583,"file_name":"b_0.png","project_id":194719,"asset_id":284915,"created_at":"2020-11-25T17:21:32.876+08:00","updated_at":"2020-11-25T17:21:32.876+08:00"},{"id":3590584,"file_name":"b_1.png","project_id":194719,"asset_id":284916,"created_at":"2020-11-25T17:21:32.877+08:00","updated_at":"2020-11-25T17:21:32.877+08:00"},{"id":3590585,"file_name":"road.jpg","project_id":194719,"asset_id":284934,"created_at":"2020-11-25T17:21:36.516+08:00","updated_at":"2020-11-25T17:21:36.516+08:00"},{"id":3590586,"file_name":"g_0.png","project_id":194719,"asset_id":284935,"created_at":"2020-11-25T17:21:36.518+08:00","updated_at":"2020-11-25T17:21:36.518+08:00"},{"id":3590589,"file_name":"p_1.png","project_id":194719,"asset_id":284938,"created_at":"2020-11-25T17:21:37.721+08:00","updated_at":"2020-11-25T17:21:37.721+08:00"},{"id":3590590,"file_name":"r_0.png","project_id":194719,"asset_id":284939,"created_at":"2020-11-25T17:21:37.722+08:00","updated_at":"2020-11-25T17:21:37.722+08:00"},{"id":3590591,"file_name":"r_1.png","project_id":194719,"asset_id":284940,"created_at":"2020-11-25T17:21:38.214+08:00","updated_at":"2020-11-25T17:21:38.214+08:00"},{"id":3590592,"file_name":"1.png","project_id":194719,"asset_id":284941,"created_at":"2020-11-25T17:21:38.216+08:00","updated_at":"2020-11-25T17:21:38.216+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦