{"id":35130,"student_id":1976,"content":"\n\n// setBackdrop('bg.jpg');\n// var platform = createSprite(\"platform.png\");\n// var rocket = createSprite([\"rocket.png\", \"bomb.png\"]);\n// var fuel = 500\n\n// rocket.x = 50\n// rocket.y = 50\n// rocket.direction = 0\n\n// platform.x = 500\n// platform.y = 450\n\n// vx = 0\n// vy = 1\n\n// var fail = 0;\n// var success = 0\n\n\n// forever(function(){\n \n// rocket.move(vx,vy)\n \n// if(fuel \u003e 0 ) {\n// if(key.up) {\n// vy -= 0.1\n// fuel -= 1\n// }\n \n// if(key.down) {\n// vy += 0.1\n// fuel -= 1\n// }\n \n// if(key.right) {\n// vx += 0.1\n// fuel -= 1\n// }\n \n// if(key.left) {\n// vx -= 0.1\n// fuel -= 1\n// }\n \n// }\n \n// if(rocket.touched(platform)) {\n// if(vy \u003e 5 || vx \u003e 5) {\n// fail += 1\n// }else {\n// success += 1\n// }\n// vx = 0\n// vy = 1\n// fuel = 500\n// var x = Math.random()*640\n// var y = Math.random()*480\n \n// var px = Math.random()*640\n \n// platform.x = px\n \n// rocket.moveTo(x,y)\n// }\n \n \n// if(rocket.x \u003c 0 || rocket.x \u003e 640 || rocket.y \u003c 0 || rocket.y \u003e 480) {\n// fail += 1\n// vx = 0\n// vy = 1\n// fuel = 500\n \n// var x = Math.random()*640\n// var y = Math.random()*480\n \n// var px = Math.random()*640\n// platform.x = px\n \n// rocket.moveTo(x,y)\n// }\n \n \n \n// vy = vy + 0.06\n \n// print(fuel,30,30,'red',30)\n// print(\"F:\"+fail, 540, 10, 'red', 20)\n// print(\"S:\"+success, 540, 30, 'red', 20)\n \n// })\n\n// rocket.x = 50;\n// rocket.y = 50;\n// rocket.direction = 0\n\n// platform.x = 500\n// platform.y = 450\n\n// vx = 0\n// vy = 0\n\n// var boom = 0;\n// var success = 0;\n\n// forever(function() {\n\n// vy += 0.06;\n// rocket.x = rocket.x + vx;\n// rocket.y = rocket.y + vy;\n\n// if (fuel \u003e 0) {\n// if (key.up) {\n// vy -= 0.1;\n// fuel -= 1;\n// }\n\n// if (key.right) {\n// vx = vx + 0.1;\n// rocket.direction += 5;\n// fuel -= 1;\n// }\n\n// if (key.left) {\n// vx = vx - 0.1;\n// rocket.direction -= 1;\n// fuel -= 1;\n// }\n// }\n\n// if (platform.touched(rocket)) {\n// if (vx \u003e 5 || vy \u003e 5 || vy \u003c -5) {\n// // rocket.costumeId = 1;\n// boom += 1\n// } else {\n// success += 1\n// }\n// var x = Math.floor(Math.random() * 641);\n// var y = Math.floor(Math.random() * 481);\n// rocket.x = x;\n// rocket.y = y;\n// rocket.direction = 0\n\n// platform.x = 500\n// platform.y = 450\n// fuel = 500\n// vx = 0\n// vy = 0\n// // stop()\n// }\n\n// if (rocket.x \u003e 640 || rocket.x \u003c 0 || rocket.y \u003c 0 || rocket.y \u003e 480) {\n// // rocket.costumeId = 1;\n// boom += 1\n\n// var x = Math.floor(Math.random() * 641);\n// var y = Math.floor(Math.random() * 481);\n\n\n// rocket.x = x;\n// rocket.y = y;\n// rocket.direction = 0\n\n// platform.x = 500\n// platform.y = 450\n// fuel = 500\n// vx = 0\n// vy = 0\n// }\n\n// print(fuel, 30, 30, 'red', 30)\n// print(\"boom:\"+boom, 540, 10, 'red', 20)\n// print(\"success:\"+success, 540, 30, 'red', 20)\n// });","created_at":"2018-07-17T14:44:43.724+08:00","updated_at":"2019-10-24T19:39:16.074+08:00","name":"火箭降落 副本","language":"javascript","screenshot":{"url":"https://cdn6.koding.school/uploads/project/screenshot/35130/27ac03f93e013900c8d89313db9cecb7.jpg"},"parent_id":31560,"plugin":"var fire = createSprite(\"fire.png\");\nfire.scale = 0.7;\nforever(function() {\n if(window.rocket \u0026\u0026 window.platform) {\n fire.x = rocket.x;\n fire.y = rocket.y;\n fire.direction = rocket.direction - 180;\n fire.stepForward(65);\n fire.direction = rocket.direction;\n if(window.rocket \u0026\u0026 (key.up || key.left || key.right) \u0026\u0026 window.fuel\u003e0) {\n fire.hidden = false;\n } else {\n fire.hidden = true;\n }\n if(rocket.touched(platform)) {\n // fire.hidden = true;\n }\n }\n});","description":"上、左、右推進火箭\n在料用盡前成功火箭降落在平台上。","note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":295,"hashid":"kdms82ek","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":639076,"file_name":"platform.png","project_id":35130,"asset_id":71105,"created_at":"2018-07-17T14:44:43.731+08:00","updated_at":"2018-07-17T14:44:43.731+08:00"},{"id":639077,"file_name":"fire.png","project_id":35130,"asset_id":71104,"created_at":"2018-07-17T14:44:43.733+08:00","updated_at":"2018-07-17T14:44:43.733+08:00"},{"id":639078,"file_name":"rocket.png","project_id":35130,"asset_id":71103,"created_at":"2018-07-17T14:44:43.734+08:00","updated_at":"2018-07-17T14:44:43.734+08:00"},{"id":639079,"file_name":"bomb.png","project_id":35130,"asset_id":71102,"created_at":"2018-07-17T14:44:43.735+08:00","updated_at":"2018-07-17T14:44:43.735+08:00"},{"id":639080,"file_name":"bg.jpg","project_id":35130,"asset_id":71101,"created_at":"2018-07-17T14:44:43.737+08:00","updated_at":"2018-07-17T14:44:43.737+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦