{"id":233535,"student_id":2002,"content":"import game #載入遊戲套件\nimport random #載入產生隨機數的套件\n\ngame.create_sprite('bg_0.png') #背景圖1\nc1 = game.create_sprite(\"cloud_1.png\") #創造角色\nc2 = game.create_sprite(\"cloud_2.png\") #創造角色\nc3 = game.create_sprite(\"cloud_3.png\") #創造角色\ngame.create_sprite('bg_1.png') #背景圖2\n\np1 = game.create_sprite('p1_0.png', 'p1_1.png', 'p1_2.png', 'p1_3.png')\np2 = game.create_sprite('p2_0.png', 'p2_1.png', 'p2_2.png', 'p2_3.png')\ninfo = game.create_sprite(\"info.png\") #創造角色\n\np1.move_to(600, 700)\np2.move_to(600, 700)\n\nc1.move_to(700, 300)\nc2.move_to(200, 150)\nc3.move_to(1150, 50)\n\nsteps = random.randint(100, 501)\n\np1.active = False\np2.active = False\n\nbgm = game.create_sound(\"bgm.mp3\", True)\n\np1.hidden = True\np2.hidden = True\n\n# 遊戲主迴圈\ndef loop ():\n global steps, p1, p2\n c1.x -= 0.3\n c2.x -= 0.5\n c3.x -= 0.7\n if c1.x \u003c -200:\n c1.x += 1500\n if c2.x \u003c -200:\n c2.x += 1500\n if c3.x \u003c -200:\n c3.x += 1500\n if steps \u003e 0:\n p1.x -= 1\n p2.x += 1\n steps -= 1\n if steps == 0 and p1.costume_id == 0:\n p1.costume_id = 1\n p2.costume_id = 1\n bgm.mute(True)\n if steps == 0 and game.key.space and p1.active == False:\n p1.costume_id = 2\n p2.costume_id = 3\n game.create_sound(\"shot.wav\")\n if steps == 0 and game.key.enter and p2.active == False:\n p2.costume_id = 2\n p1.costume_id = 3\n game.create_sound(\"shot.wav\")\n if game.key.space:\n p1.active = True\n if game.key.enter:\n p2.active = True\n if game.key.r:\n p1.move_to(600, 700)\n p2.move_to(600, 700)\n p1.costume_id = 0\n p2.costume_id = 0\n p1.active = False\n p2.active = False\n steps = random.randint(100, 501)\n bgm.mute(False)\n p1.hidden = False\n p2.hidden = False\n info.hidden = True\nforever(loop) #不斷執行遊戲迴圈","created_at":"2021-03-07T13:37:32.454+08:00","updated_at":"2021-03-07T14:46:38.155+08:00","name":"牛仔大對決(預設版) 副本","language":"python","screenshot":{"url":"https://cdn6.koding.school/uploads/project/screenshot/233535/68d0121ae2013bb2225123e2e5ba0a20.jpg"},"parent_id":183412,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":52,"hashid":"wdks4mme2","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":4213673,"file_name":"shot.wav","project_id":233535,"asset_id":251747,"created_at":"2021-03-07T13:37:32.459+08:00","updated_at":"2021-03-07T13:37:32.459+08:00"},{"id":4213674,"file_name":"p2_3.png","project_id":233535,"asset_id":251748,"created_at":"2021-03-07T13:37:32.460+08:00","updated_at":"2021-03-07T13:37:32.460+08:00"},{"id":4213675,"file_name":"p2_2.png","project_id":233535,"asset_id":251749,"created_at":"2021-03-07T13:37:32.461+08:00","updated_at":"2021-03-07T13:37:32.461+08:00"},{"id":4213676,"file_name":"p2_1.png","project_id":233535,"asset_id":251750,"created_at":"2021-03-07T13:37:32.462+08:00","updated_at":"2021-03-07T13:37:32.462+08:00"},{"id":4213677,"file_name":"p2_0.png","project_id":233535,"asset_id":251751,"created_at":"2021-03-07T13:37:32.463+08:00","updated_at":"2021-03-07T13:37:32.463+08:00"},{"id":4213678,"file_name":"p1_3.png","project_id":233535,"asset_id":251752,"created_at":"2021-03-07T13:37:32.464+08:00","updated_at":"2021-03-07T13:37:32.464+08:00"},{"id":4213679,"file_name":"p1_2.png","project_id":233535,"asset_id":251753,"created_at":"2021-03-07T13:37:32.465+08:00","updated_at":"2021-03-07T13:37:32.465+08:00"},{"id":4213680,"file_name":"p1_1.png","project_id":233535,"asset_id":251754,"created_at":"2021-03-07T13:37:32.466+08:00","updated_at":"2021-03-07T13:37:32.466+08:00"},{"id":4213681,"file_name":"p1_0.png","project_id":233535,"asset_id":251755,"created_at":"2021-03-07T13:37:32.466+08:00","updated_at":"2021-03-07T13:37:32.466+08:00"},{"id":4213682,"file_name":"info.png","project_id":233535,"asset_id":251756,"created_at":"2021-03-07T13:37:32.467+08:00","updated_at":"2021-03-07T13:37:32.467+08:00"},{"id":4213683,"file_name":"cloud_3.png","project_id":233535,"asset_id":251757,"created_at":"2021-03-07T13:37:32.468+08:00","updated_at":"2021-03-07T13:37:32.468+08:00"},{"id":4213684,"file_name":"cloud_2.png","project_id":233535,"asset_id":251758,"created_at":"2021-03-07T13:37:32.469+08:00","updated_at":"2021-03-07T13:37:32.469+08:00"},{"id":4213685,"file_name":"cloud_1.png","project_id":233535,"asset_id":251759,"created_at":"2021-03-07T13:37:32.470+08:00","updated_at":"2021-03-07T13:37:32.470+08:00"},{"id":4213686,"file_name":"bgm.mp3","project_id":233535,"asset_id":251760,"created_at":"2021-03-07T13:37:32.471+08:00","updated_at":"2021-03-07T13:37:32.471+08:00"},{"id":4213687,"file_name":"bg_1.png","project_id":233535,"asset_id":251761,"created_at":"2021-03-07T13:37:32.472+08:00","updated_at":"2021-03-07T13:37:32.472+08:00"},{"id":4213688,"file_name":"bg_0.png","project_id":233535,"asset_id":251762,"created_at":"2021-03-07T13:37:32.473+08:00","updated_at":"2021-03-07T13:37:32.473+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦