{"id":183079,"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 player_1.costumeId = 1;\n player_2.costumeId = 1;\n }\n\n//如果右邊玩家按下按鍵 且 已經轉身\nif(key.enter \u0026\u0026 player_2.costumeId == 1) {\nplayer_1.costumeId = 2;\nplayer_2.costumeId = 3;\n}\n\n//如果左邊玩家按下按鍵 且 已經轉身\nif(key.space \u0026\u0026 player_2.costumeId == 1) {\nplayer_2.costumeId = 2;\nplayer_1.costumeId = 3;\n }\n});","created_at":"2020-08-19T20:31:55.969+08:00","updated_at":"2022-11-02T15:10:18.648+08:00","name":"L4_牛仔大對決_除錯範例 副本","language":"javascript","screenshot":{"url":"/uploads/project/screenshot/183079/63f0100b68bcbc0ee0935c82090687de.jpg"},"parent_id":182988,"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":438,"hashid":"gk4sz4nk","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":3114307,"file_name":"bg.png","project_id":183079,"asset_id":127588,"created_at":"2020-08-19T20:31:55.975+08:00","updated_at":"2020-08-19T20:31:55.975+08:00"},{"id":3114308,"file_name":"shot.wav","project_id":183079,"asset_id":127589,"created_at":"2020-08-19T20:31:55.976+08:00","updated_at":"2020-08-19T20:31:55.976+08:00"},{"id":3114309,"file_name":"left_1.png","project_id":183079,"asset_id":127590,"created_at":"2020-08-19T20:31:55.977+08:00","updated_at":"2020-08-19T20:31:55.977+08:00"},{"id":3114310,"file_name":"left_0.png","project_id":183079,"asset_id":127591,"created_at":"2020-08-19T20:31:55.978+08:00","updated_at":"2020-08-19T20:31:55.978+08:00"},{"id":3114311,"file_name":"left_2.png","project_id":183079,"asset_id":127592,"created_at":"2020-08-19T20:31:55.978+08:00","updated_at":"2020-08-19T20:31:55.978+08:00"},{"id":3114312,"file_name":"left_3.png","project_id":183079,"asset_id":127593,"created_at":"2020-08-19T20:31:55.979+08:00","updated_at":"2020-08-19T20:31:55.979+08:00"},{"id":3114313,"file_name":"right_0.png","project_id":183079,"asset_id":127594,"created_at":"2020-08-19T20:31:55.980+08:00","updated_at":"2020-08-19T20:31:55.980+08:00"},{"id":3114314,"file_name":"right_1.png","project_id":183079,"asset_id":127595,"created_at":"2020-08-19T20:31:55.981+08:00","updated_at":"2020-08-19T20:31:55.981+08:00"},{"id":3114315,"file_name":"right_2.png","project_id":183079,"asset_id":127596,"created_at":"2020-08-19T20:31:55.982+08:00","updated_at":"2020-08-19T20:31:55.982+08:00"},{"id":3114316,"file_name":"right_3.png","project_id":183079,"asset_id":127597,"created_at":"2020-08-19T20:31:55.983+08:00","updated_at":"2020-08-19T20:31:55.983+08:00"}]
Orange Apple Learning Platform
My Projects
View Project Page
Export
Remix
Import
Delete
Download Android APP (APK)
Screenshot
繁中
简中
English
日本語
1:1:1
1:1
Full Width
Scan the QRCode below with your phone to install
Or you can
download APK
to this computer
Scan the QRCode below with your phone to install
Or you can
download APK
to this computer