{"id":24311,"student_id":3206,"content":"setBackdrop('bg.png', 0, 0, 640, 480);\nvar p1 = createSprite([\"right_0.png\", \"right_1.png\", \"right_2.png\", \"right_3.png\"]);\np1.x = 340;\np1.y = 400,\np1.scale = 1.3;\n\nvar p2 = createSprite([\"left_0.png\", \"left_1.png\", \"left_2.png\", \"left_3.png\"]);\np2.x = 300;\np2.y = 400;\np2.scale = 1.3;\nvar bo = createSprite(['bo.png'])\nvar step = Math.random()*200 + 90;\nstep = Math.round(step);\nvar p1_isshoot = 20;\nvar p2_isshoot = 20;\nvar j = 1;\nbo.scale = 0.09\nif (key.enter) {\n p1_isshoot -= 1;\n}\nif (key.space) {\n p2_isshoot -= 1;\n}\nforever(function() {\n\n step -= 1;\n if (step \u003e 0) {\n p1.x += 1;\n p2.x -= 1;\n step -= 1;\n }\n if (j \u003e= 1) {\n if (step \u003c= 0 \u0026\u0026 p1.costumeId == 0 \u0026\u0026 p2.costumeId == 0) {\n p1.costumeId = 1;\n p2.costumeId = 1;\n }\n\n if (p2.y \u003c= 400) {\n p2.y += 5;\n }\n if (p1.y \u003c= 400) {\n p1.y += 5;\n }\n\n if (p1.costumeId == 1 \u0026\u0026 p2.costumeId == 1) {\n if (key.a) {\n p2.x -= 3;\n }\n if (key.d) {\n p2.x += 3\n }\n if (p2.y \u003e= 280) {\n if (key.w) {\n p2.y -= 15\n }\n }\n if (key.left) {\n p1.x -= 3;\n }\n if (key.right) {\n p1.x += 3\n }\n if (p1.y \u003e= 280) {\n if (key.up) {\n p1.y -= 15\n }\n }\n if (p1_isshoot \u003e= 0) {\n if (key.enter) {\n p1.costumeId = 2;\n p2.costumeId = 3;\n sound.play('shot.wav')\n }\n }\n if (p2_isshoot \u003e= 0) {\n if (p2.x == p1.x) {\n if (key.space) {\n p2.costumeId = 2;\n p1.costumeId = 3;\n sound.play('shot.wav')\n } else {\n if(key.space){\n p2.costumeId = 2;\n sound.play('shot.wav')\n setTimeout(function() {\n p2.costumeId = 1;\n }, 10);\n }\n }\n \n }\n }\n /*if(p1_isshoot\u003c=0\u0026\u0026p2_isshoot\u003c=0)\n {\n p1.costumeId=3;\n p2.costumeId=3;\n sound.play('shot.wav')\n j-=1;\n setTimeout(function() {\n stop();\n }, 2000);\n }*/\n }}\n print(p2_isshoot, 20, 20, \"red\", 30)\n\n});","created_at":"2018-03-10T18:48:39.364+08:00","updated_at":"2019-06-01T13:52:09.480+08:00","name":"牛仔大對決","language":"javascript","screenshot":{"url":"https://cdn4.koding.school/uploads/project/screenshot/24311/c1246adc1cb5a752c6d6141e5d9c250e.jpg"},"parent_id":10701,"plugin":"","description":"","note":"","status":"public","like_student_ids":[],"is_featured":false,"views":76,"hashid":"yeysqkqd","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":461008,"file_name":"bg.png","project_id":24311,"asset_id":28736,"created_at":"2018-03-10T18:48:39.377+08:00","updated_at":"2018-03-10T18:48:39.377+08:00"},{"id":461009,"file_name":"shot.wav","project_id":24311,"asset_id":28737,"created_at":"2018-03-10T18:48:39.380+08:00","updated_at":"2018-03-10T18:48:39.380+08:00"},{"id":461010,"file_name":"left_1.png","project_id":24311,"asset_id":28738,"created_at":"2018-03-10T18:48:39.383+08:00","updated_at":"2018-03-10T18:48:39.383+08:00"},{"id":461011,"file_name":"left_0.png","project_id":24311,"asset_id":28739,"created_at":"2018-03-10T18:48:39.385+08:00","updated_at":"2018-03-10T18:48:39.385+08:00"},{"id":461012,"file_name":"left_2.png","project_id":24311,"asset_id":28740,"created_at":"2018-03-10T18:48:39.388+08:00","updated_at":"2018-03-10T18:48:39.388+08:00"},{"id":461013,"file_name":"left_3.png","project_id":24311,"asset_id":28741,"created_at":"2018-03-10T18:48:39.394+08:00","updated_at":"2018-03-10T18:48:39.394+08:00"},{"id":461014,"file_name":"right_0.png","project_id":24311,"asset_id":28742,"created_at":"2018-03-10T18:48:39.397+08:00","updated_at":"2018-03-10T18:48:39.397+08:00"},{"id":461015,"file_name":"right_1.png","project_id":24311,"asset_id":28743,"created_at":"2018-03-10T18:48:39.399+08:00","updated_at":"2018-03-10T18:48:39.399+08:00"},{"id":461016,"file_name":"right_2.png","project_id":24311,"asset_id":28744,"created_at":"2018-03-10T18:48:39.402+08:00","updated_at":"2018-03-10T18:48:39.402+08:00"},{"id":461017,"file_name":"right_3.png","project_id":24311,"asset_id":28745,"created_at":"2018-03-10T18:48:39.404+08:00","updated_at":"2018-03-10T18:48:39.404+08:00"},{"id":702479,"file_name":"卡通-核彈-美工圖案__k21250216.jpg","project_id":24311,"asset_id":82913,"created_at":"2018-08-25T13:43:38.960+08:00","updated_at":"2018-08-25T13:43:38.960+08:00"},{"id":703320,"file_name":"bo.png","project_id":24311,"asset_id":82934,"created_at":"2018-08-25T14:36:38.693+08:00","updated_at":"2018-08-25T14:37:03.059+08:00"}]
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
繁中
简中
English
日本語
1:1:1
1:1
全寬
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦