{"id":14816,"student_id":168,"content":"setBackdrop('bg.png',0, 0, 640, 480);\n\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;\n \nvar step = Math.random()*400 + 100;\nvar p1_shot = \"false\"\nvar p2_shot = \"false\"\nstep = Math.round(step);\n\nforever(function() {\n step -= 1\n if(step \u003e 0) {\n \tp1.move (0.5,0)\n p2.move (-0.5,0)\n if(key.enter) {\n p1_shot = \"true\"\n }\n if(key.space) {\n p2_shot = \"true\"\n } \n }\n if(step == 0) {\n p1.costumeId = 1;\n p2.costumeId = 1;\n }\n if(key.enter \u0026\u0026 p1_shot == \"false\") {\n sound.play(\"shot.wav\")\n p1.costumeId = 2\n p2.costumeId = 3\n p1_shot = \"true\"\n p2_shot = \"true\"\n forever(function(){\n print(\"P1 win\",320,240,\"black\",50)\n });\n }\n\n if(key.space \u0026\u0026 p2_shot == \"false\") {\n sound.play(\"shot.wav\")\n p1.costumeId = 3\n p2.costumeId = 2\n p2_shot = \"true\"\n p1_shot = \"true\"\n forever(function(){\n print(\"P2 win\",160,240,\"black\",50)\n });\n }\n \n});\nsetInterval(function(){\n var snow = createSprite(\"雪.png\");\n snow.scale = 0.3 + Math.random()*2\n snow.x = Math.random()*640;\n snow.y = 480 \n snow.forever(function(){\n this.y -= 1 + Math.random()*3\n });\n\n var snow2 = createSprite(\"雪.png\");\n snow2.scale = 0.3 + Math.random()*2\n snow2.x = Math.random()*640;\n snow2.y = 0 \n snow2.forever(function(){\n this.y += 1 + Math.random()*3\n });\n\n var snow3 = createSprite(\"雪2.png\");\n snow3.scale = 0.3 + Math.random()*2\n snow3.y = Math.random()*480;\n snow3.x = 0 \n snow3.forever(function(){\n this.x += 1 + Math.random()*3\n });\n\n var snow4 = createSprite(\"雪2.png\");\n snow4.scale = 0.3 + Math.random()*2\n snow4.y = Math.random()*480;\n snow4.x = 640 \n snow4.forever(function(){\n this.x -= 1 + Math.random()*3\n });\n if(this.y \u003e 500){\n this.destroy()\n }\n if(this.x \u003e 660){\n this.destroy()\n }\n if(this.x \u003c 0){\n this.destroy()\n }\n if(this.y \u003c 0){\n this.destroy()\n }\n},3);","created_at":"2017-03-01T20:52:04.729+08:00","updated_at":"2019-07-27T16:04:07.713+08:00","name":"牛仔大對決","language":"javascript","screenshot":{"url":"https://cdn9.koding.school/uploads/project/screenshot/14816/5373db7b22ac82b3f35af12e3c320511.jpg"},"parent_id":10701,"plugin":"","description":"","note":"","status":"public","like_student_ids":[],"is_featured":false,"views":104,"hashid":"4y3sgee5","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":310662,"file_name":"bg.png","project_id":14816,"asset_id":28736,"created_at":"2017-11-04T16:55:36.403+08:00","updated_at":"2017-11-04T16:55:36.403+08:00"},{"id":310663,"file_name":"shot.wav","project_id":14816,"asset_id":28737,"created_at":"2017-11-04T16:55:36.405+08:00","updated_at":"2017-11-04T16:55:36.405+08:00"},{"id":310664,"file_name":"left_1.png","project_id":14816,"asset_id":28738,"created_at":"2017-11-04T16:55:36.407+08:00","updated_at":"2017-11-04T16:55:36.407+08:00"},{"id":310665,"file_name":"left_0.png","project_id":14816,"asset_id":28739,"created_at":"2017-11-04T16:55:36.408+08:00","updated_at":"2017-11-04T16:55:36.408+08:00"},{"id":310666,"file_name":"left_2.png","project_id":14816,"asset_id":28740,"created_at":"2017-11-04T16:55:36.410+08:00","updated_at":"2017-11-04T16:55:36.410+08:00"},{"id":310667,"file_name":"left_3.png","project_id":14816,"asset_id":28741,"created_at":"2017-11-04T16:55:36.411+08:00","updated_at":"2017-11-04T16:55:36.411+08:00"},{"id":310668,"file_name":"right_0.png","project_id":14816,"asset_id":28742,"created_at":"2017-11-04T16:55:36.413+08:00","updated_at":"2017-11-04T16:55:36.413+08:00"},{"id":310669,"file_name":"right_1.png","project_id":14816,"asset_id":28743,"created_at":"2017-11-04T16:55:36.415+08:00","updated_at":"2017-11-04T16:55:36.415+08:00"},{"id":310670,"file_name":"right_2.png","project_id":14816,"asset_id":28744,"created_at":"2017-11-04T16:55:36.416+08:00","updated_at":"2017-11-04T16:55:36.416+08:00"},{"id":310671,"file_name":"right_3.png","project_id":14816,"asset_id":28745,"created_at":"2017-11-04T16:55:36.417+08:00","updated_at":"2017-11-04T16:55:36.417+08:00"},{"id":321421,"file_name":"adb89c7109a48026156fe168a20e30c9.png","project_id":14816,"asset_id":16812,"created_at":"2017-11-11T17:11:49.336+08:00","updated_at":"2017-11-11T17:11:49.336+08:00"},{"id":321519,"file_name":"雪.png","project_id":14816,"asset_id":37809,"created_at":"2017-11-11T17:49:18.245+08:00","updated_at":"2017-11-11T17:49:18.245+08:00"},{"id":321520,"file_name":"雪2.png","project_id":14816,"asset_id":37810,"created_at":"2017-11-11T17:49:18.247+08:00","updated_at":"2017-11-11T17:49:18.247+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦