{"id":182988,"student_id":10,"content":"/**\n * 學生:老師我的牛仔沒辦法成功轉身...\n * 提示:此範例有三處程式有相似的錯誤!\n */\n\n//初始化隨機「剩餘步數」\nvar step = Math.random()*200 + 50;\nstep = Math.round(step);\n\n\nvar shot_1 = false;\nvar shot_2 = false;\n\nforever(function() {\n \n step = step - 1; //遊戲迴圈每次執行時,步數減一\n \n //如果剩餘步數大於 0 雙方角色就背對背移動一步\n if(step \u003e 0) {\n \tplayer_1.x += 1;\n player_2.x -= 1;\n }\n \n //如果剩餘步數等於 0 雙方牛仔就切換轉身造型\n if(step === 0) {\n playar_1.costumeId = 1;\n player_2.costumeId = 1;\n }\n\n//如果右邊玩家按下按鍵 且 已經轉身\nif(key.enter \u0026\u0026 player_2.costumeId == 1) {\nplayar_1.costumeId = 2;\nplayer_2.costumeId = 3;\n}\n\n//如果左邊玩家按下按鍵 且 已經轉身\nif(key.space \u0026\u0026 player_2.costumeId == 1) {\nplayar_2.costumeId = 2;\nplayer_1.costumeId = 3;\n }\n});","created_at":"2020-08-19T15:24:37.651+08:00","updated_at":"2020-11-18T18:41:27.723+08:00","name":"L4_牛仔大對決_除錯範例","language":"javascript","screenshot":{"url":"https://cdn9.koding.school/uploads/project/screenshot/182988/89edcce60b8890776f43b51e69f48ea4.jpg"},"parent_id":73443,"plugin":"setBackdrop('bg.png',0, 0, 640, 480);\nvar player_1 = createSprite({\n\tcostumes: [\"right_0.png\",\"right_1.png\",\"right_2.png\",\"right_3.png\"],\n x: 340,\n y: 400,\n scale: 1.3\n});\nvar player_2 = createSprite({\n\tcostumes: [\"left_0.png\",\"left_1.png\",\"left_2.png\",\"left_3.png\"],\n x: 300,\n y: 400,\n scale: 1.3\n});","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":222,"hashid":"5j3skmkm","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":3112658,"file_name":"right_3.png","project_id":182988,"asset_id":127597,"created_at":"2020-08-19T15:24:37.657+08:00","updated_at":"2020-08-19T15:24:37.657+08:00"},{"id":3112659,"file_name":"right_2.png","project_id":182988,"asset_id":127596,"created_at":"2020-08-19T15:24:37.658+08:00","updated_at":"2020-08-19T15:24:37.658+08:00"},{"id":3112660,"file_name":"right_1.png","project_id":182988,"asset_id":127595,"created_at":"2020-08-19T15:24:37.659+08:00","updated_at":"2020-08-19T15:24:37.659+08:00"},{"id":3112661,"file_name":"right_0.png","project_id":182988,"asset_id":127594,"created_at":"2020-08-19T15:24:37.660+08:00","updated_at":"2020-08-19T15:24:37.660+08:00"},{"id":3112662,"file_name":"left_3.png","project_id":182988,"asset_id":127593,"created_at":"2020-08-19T15:24:37.661+08:00","updated_at":"2020-08-19T15:24:37.661+08:00"},{"id":3112663,"file_name":"left_2.png","project_id":182988,"asset_id":127592,"created_at":"2020-08-19T15:24:37.662+08:00","updated_at":"2020-08-19T15:24:37.662+08:00"},{"id":3112664,"file_name":"left_0.png","project_id":182988,"asset_id":127591,"created_at":"2020-08-19T15:24:37.663+08:00","updated_at":"2020-08-19T15:24:37.663+08:00"},{"id":3112665,"file_name":"left_1.png","project_id":182988,"asset_id":127590,"created_at":"2020-08-19T15:24:37.664+08:00","updated_at":"2020-08-19T15:24:37.664+08:00"},{"id":3112666,"file_name":"shot.wav","project_id":182988,"asset_id":127589,"created_at":"2020-08-19T15:24:37.665+08:00","updated_at":"2020-08-19T15:24:37.665+08:00"},{"id":3112667,"file_name":"bg.png","project_id":182988,"asset_id":127588,"created_at":"2020-08-19T15:24:37.666+08:00","updated_at":"2020-08-19T15:24:37.666+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦