{"id":14115,"student_id":104,"content":"setBackdrop('bg.jpg'); //設定背景\nvar platform = createSprite(\"platform.png\"); //建立角色\nvar rocket = createSprite([\"rocket.png\",\"bomb.png\"]); //建立角色 - 陣列\nvar vy = 0; //重力加速度\nvar vx = 0;\nvar fuel = 500;\n// 1.角色位置初始化\nrocket.x = 50;\nrocket.y = 50;\nrocket.direction = 0;\n\nforever(function() { \n vy += 0.05; //重力加速度\n rocket.y += vy;\n rocket.x += vx;\n // 使用鍵盤上鑑,火箭往上移動\n if(fuel \u003e 0){\n if(key.up){\n vy -= 0.1;\n fuel -= 1;\n }\n if(key.right){\n vx += 0.1;\n fuel -= 1;\n }\n if(key.left){\n vx -= 0.1;\n fuel -= 1;\n }\n }\n //火箭撞到平台,遊戲結束\n if(rocket.touched(platform)){\n stop();\n }\n\n print(\"燃料:\" + fuel, 30, 20, \"white\", 25);\n});","created_at":"2017-03-01T20:52:04.729+08:00","updated_at":"2019-11-10T15:26:16.206+08:00","name":"火箭降落","language":"javascript","screenshot":{"url":"https://cdn0.koding.school/uploads/project/screenshot/14115/621314ae1199332098aa46a9948e0331.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":86,"hashid":"npms39d4","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":288739,"file_name":"bg.jpg","project_id":14115,"asset_id":19411,"created_at":"2017-10-28T10:19:29.467+08:00","updated_at":"2017-10-28T10:19:29.467+08:00"},{"id":288740,"file_name":"bomb.png","project_id":14115,"asset_id":19412,"created_at":"2017-10-28T10:19:29.469+08:00","updated_at":"2017-10-28T10:19:29.469+08:00"},{"id":288741,"file_name":"rocket.png","project_id":14115,"asset_id":19413,"created_at":"2017-10-28T10:19:29.471+08:00","updated_at":"2017-10-28T10:19:29.471+08:00"},{"id":288742,"file_name":"fire.png","project_id":14115,"asset_id":19414,"created_at":"2017-10-28T10:19:29.473+08:00","updated_at":"2017-10-28T10:19:29.473+08:00"},{"id":288743,"file_name":"platform.png","project_id":14115,"asset_id":19415,"created_at":"2017-10-28T10:19:29.475+08:00","updated_at":"2017-10-28T10:19:29.475+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦