{"id":67737,"student_id":1443,"content":"setBackdrop('bg.jpg');\nvar platform = createSprite(\"platform.png\");\nvar rocket = createSprite([\"rocket.png\", \"bomb.png\"]);\nvar fuel = 500;\nvar vy = 0;\nvar vx = 0;\n\nplatform.x = 500;\nplatform.y = 450;\nrocket.x = 50;\nrocket.y = 50;\nrocket.direction = 0;\n\n\n\nforever(function() {\n rocket.y += vy;\n rocket.x += vx;\n rocket.direction = vx * 10\n\n if (rocket.touched(platform)) {\n ///垂直速度往下太快爆炸\n if (vy \u003e 1) {\n rocket.costumeId = 1;\n }\n ///太傾斜也會爆炸\n if (rocket.direction \u003e 6 || rocket.direction \u003c -6) {\n rocket.costumeId = 1;\n }\n\n stop();\n }\n\n ///超過邊界也會爆炸\n if (rocket.y \u003c 0 || rocket.y \u003e 480 || rocket.x \u003c 0 || rocket.x \u003e 640) {\n rocket.costumeId = 1;\n stop();\n }\n if (fuel \u003e 0) {\n if (key.up) {\n //按下上鍵,垂直速度往上增加0.1\n vy -= 0.1;\n fuel -= 1;\n }\n if (key.right) {\n //按下右鍵,水平速度往右增加0.1\n vx += 0.1;\n fuel -= 1;\n }\n if (key.left) {\n //按下左鍵,水平速度往左增加0.1\n vx -= 0.1;\n fuel -= 1;\n }\n\n }\n\n\n\n //重力加速次影響,垂直往下增加速度0.06\n vy += 0.06;\n\n print(\"fule:\"+ fuel, 10, 10, \"red\", 20);\n print(\"垂直移動速度vy\"+ vy, 10, 40, \"white\", 30);\n print(\"平行移動速度vx\"+ vx, 10, 70, \"white\", 30);\n print(\"角度\"+rocket.direction, 10, 100, \"white\", 30);\n});","created_at":"2019-05-16T20:00:20.779+08:00","updated_at":"2023-03-11T14:17:41.091+08:00","name":"火箭降落 副本","language":"javascript","screenshot":{"url":"https://cdn7.koding.school/uploads/project/screenshot/67737/5f479829a449564c292ca7f58c89be56.jpg"},"parent_id":10697,"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":96,"hashid":"gk4smjrr","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":1185104,"file_name":"bg.jpg","project_id":67737,"asset_id":19411,"created_at":"2019-05-16T20:00:20.784+08:00","updated_at":"2019-05-16T20:00:20.784+08:00"},{"id":1185105,"file_name":"bomb.png","project_id":67737,"asset_id":19412,"created_at":"2019-05-16T20:00:20.786+08:00","updated_at":"2019-05-16T20:00:20.786+08:00"},{"id":1185106,"file_name":"rocket.png","project_id":67737,"asset_id":19413,"created_at":"2019-05-16T20:00:20.787+08:00","updated_at":"2019-05-16T20:00:20.787+08:00"},{"id":1185107,"file_name":"fire.png","project_id":67737,"asset_id":19414,"created_at":"2019-05-16T20:00:20.788+08:00","updated_at":"2019-05-16T20:00:20.788+08:00"},{"id":1185108,"file_name":"platform.png","project_id":67737,"asset_id":19415,"created_at":"2019-05-16T20:00:20.788+08:00","updated_at":"2019-05-16T20:00:20.788+08:00"}]
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
繁中
简中
English
日本語
1:1:1
1:1
全寬
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦