{"id":129603,"student_id":10,"content":"createSprite('bg_0.png'); //背景圖1\nvar c1 = createSprite('cloud_1.png');\nvar c2 = createSprite('cloud_2.png');\nvar c3 = createSprite('cloud_3.png');\ncreateSprite('bg_1.png'); //背景圖2\nvar p1 = createSprite('p1_0.png', 'p1_1.png', 'p1_2.png', 'p1_3.png'); //左邊牛仔\nvar p2 = createSprite('p2_0.png', 'p2_1.png', 'p2_2.png', 'p2_3.png'); //右邊牛仔\nvar info = createSprite('info.png'); //遊戲說明\n\nvar steps = -1; //移動的剩餘步數\nvar p1_fired = false; //p1是否已經開槍\nvar p2_fired = false; //p2是否已經開槍\nvar bgm = sound.play('bgm.mp3', true);\n\np1.moveTo(600, 700);\np2.moveTo(600, 700);\nc1.moveTo(700, 300);\nc2.moveTo(200, 150);\nc3.moveTo(1100, 50);\n\np1.hidden = true;\np2.hidden = true;\n\nforever(loop); //不斷執行遊戲迴圈\n\n// 遊戲主迴圈\nfunction loop () {\n \n if (steps \u003e 0) {\n steps -= 1;\n p1.x -= 1;\n p2.x += 1;\n }\n \n //如果剩餘步數為零 且 雙方還在走路造型\n if (steps == 0 \u0026\u0026 p1.costumeId == 0) {\n p1.costumeId = 1; //角色轉身\n p2.costumeId = 1; //角色轉身\n bgm.mute(true);\n }\n \n //按下空白鍵 且 角色已經轉身 且 p1 還沒開槍\n if (key.space \u0026\u0026 p2.costumeId == 1 \u0026\u0026 p1_fired == false) {\n p1.costumeId = 2;\n p2.costumeId = 3;\n sound.play('shot.wav');\n }\n \n //按下enter 且 角色已經轉身 且 p2 還沒開槍\n if (key.enter \u0026\u0026 p2.costumeId == 1 \u0026\u0026 p2_fired == false) {\n p2.costumeId = 2;\n p1.costumeId = 3;\n sound.play('shot.wav');\n }\n \n //紀錄雙方玩家是否按下按鍵\n if (key.enter) {\n p2_fired = true;\n }\n if (key.space) {\n p1_fired = true;\n }\n \n //重新開始\n if (key.r) {\n p1.moveTo(600, 700);\n p2.moveTo(600, 700);\n p1.costumeId = 0;\n p2.costumeId = 0;\n p1_fired = false;\n p2_fired = false;\n steps = Math.floor(Math.random()*400 + 100);\n p1.hidden = false;\n p2.hidden = false;\n info.hidden = true;\n bgm.mute(false);\n }\n\n c1.x -= 0.3;\n if (c1.x \u003c -200) {\n c1.x += 1500;\n }\n c2.x -= 0.5;\n if (c2.x \u003c -200) {\n c2.x += 1500;\n }\n c3.x -= 0.7;\n if (c3.x \u003c -200) {\n c3.x += 1500;\n }\n}","created_at":"2020-03-04T17:20:41.312+08:00","updated_at":"2020-08-20T13:34:17.838+08:00","name":"牛仔大對決(完整版)","language":"javascript","screenshot":{"url":"https://cdn4.koding.school/uploads/project/screenshot/129603/26e1f20ce8035be5684c61c785e0844a.jpg"},"parent_id":114832,"plugin":"Game.set({\n width: 1200,\n height: 900,\n})","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":250,"hashid":"kdmserkm","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":2225876,"file_name":"shot.wav","project_id":129603,"asset_id":172548,"created_at":"2020-03-04T17:20:41.338+08:00","updated_at":"2020-03-04T17:20:41.338+08:00"},{"id":2225877,"file_name":"bgm.mp3","project_id":129603,"asset_id":172549,"created_at":"2020-03-04T17:20:41.340+08:00","updated_at":"2020-03-04T17:20:41.340+08:00"},{"id":3116057,"file_name":"info.png","project_id":129603,"asset_id":251381,"created_at":"2020-08-20T13:34:03.742+08:00","updated_at":"2020-08-20T13:34:03.742+08:00"},{"id":3116058,"file_name":"p1_0.png","project_id":129603,"asset_id":251382,"created_at":"2020-08-20T13:34:03.743+08:00","updated_at":"2020-08-20T13:34:03.743+08:00"},{"id":3116061,"file_name":"p1_3.png","project_id":129603,"asset_id":251385,"created_at":"2020-08-20T13:34:04.069+08:00","updated_at":"2020-08-20T13:34:04.069+08:00"},{"id":3116062,"file_name":"p2_0.png","project_id":129603,"asset_id":251386,"created_at":"2020-08-20T13:34:04.071+08:00","updated_at":"2020-08-20T13:34:04.071+08:00"},{"id":3116053,"file_name":"board.png","project_id":129603,"asset_id":251377,"created_at":"2020-08-20T13:34:03.400+08:00","updated_at":"2020-08-20T13:34:03.400+08:00"},{"id":3116054,"file_name":"cloud_1.png","project_id":129603,"asset_id":251378,"created_at":"2020-08-20T13:34:03.401+08:00","updated_at":"2020-08-20T13:34:03.401+08:00"},{"id":3116055,"file_name":"cloud_2.png","project_id":129603,"asset_id":251379,"created_at":"2020-08-20T13:34:03.564+08:00","updated_at":"2020-08-20T13:34:03.564+08:00"},{"id":3116056,"file_name":"cloud_3.png","project_id":129603,"asset_id":251380,"created_at":"2020-08-20T13:34:03.566+08:00","updated_at":"2020-08-20T13:34:03.566+08:00"},{"id":3116067,"file_name":"bg_1.png","project_id":129603,"asset_id":251376,"created_at":"2020-08-20T13:34:42.396+08:00","updated_at":"2020-08-20T13:34:42.396+08:00"},{"id":3116066,"file_name":"bg_0.png","project_id":129603,"asset_id":251375,"created_at":"2020-08-20T13:34:42.394+08:00","updated_at":"2020-08-20T13:35:01.798+08:00"},{"id":3116059,"file_name":"p1_1.png","project_id":129603,"asset_id":251383,"created_at":"2020-08-20T13:34:03.908+08:00","updated_at":"2020-08-20T13:34:03.908+08:00"},{"id":3116060,"file_name":"p1_2.png","project_id":129603,"asset_id":251384,"created_at":"2020-08-20T13:34:03.909+08:00","updated_at":"2020-08-20T13:34:03.909+08:00"},{"id":3116063,"file_name":"p2_1.png","project_id":129603,"asset_id":251387,"created_at":"2020-08-20T13:34:04.235+08:00","updated_at":"2020-08-20T13:34:04.235+08:00"},{"id":3116064,"file_name":"p2_2.png","project_id":129603,"asset_id":251388,"created_at":"2020-08-20T13:34:04.236+08:00","updated_at":"2020-08-20T13:34:04.236+08:00"},{"id":3116065,"file_name":"p2_3.png","project_id":129603,"asset_id":251389,"created_at":"2020-08-20T13:34:04.430+08:00","updated_at":"2020-08-20T13:34:04.430+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦