{"id":7311,"student_id":10,"content":"setBackdrop('black');\nvar ship = createSprite(\"ship.png\");\nvar food = createSprite(\"food.png\", \"food.png\");\nfood.x = 50 + Math.random() * 540;\nfood.y = 50 + Math.random() * 380;\nship.layer = 1;\n\nvar shadows = [];\nvar bullets = [];\nvar score = 0;\nvar clock = 0;\nvar life = 5;\nvar freeze = false;\nvar end = 0;\n\nsound.play('bgm.mp3', true);\n\nforever(loop)\n\nfunction loop () {\n var speed = ship.distanceTo(cursor)/20;\n ship.toward(cursor);\n ship.stepForward(speed);\n\n clock++;\n if (clock%8 == 0 || (clock \u003e end \u0026\u0026 clock %2 == 0)) {\n var bullet = createSprite('bullet.png','bullet.png');\n bullet.direction = Math.random()*360;\n bullet.stepForward(500);\n bullet.direction = Math.random()*360;;\n bullets.push(bullet);\n }\n if (clock%5 == 0) {\n var shadow = createSprite('flame.png');\n shadow.direction = ship.direction;\n shadow.moveTo(ship);\n shadows.push(shadow);\n }\n for (var i = 0; i \u003c bullets.length; i++) {\n var b = bullets[i];\n if (clock \u003c end) {\n b.stepForward(0.5);\n b.costumeId = 1;\n } else {\n b.stepForward(2);\n b.costumeId = 0;\n }\n if (b.distanceTo(320, 240) \u003e 500) {\n b.destroy();\n }\n if (b.touched(ship)) {\n b.destroy();\n life--;\n }\n }\n if (clock % 600 == 0 \u0026\u0026 life \u003c 5) {\n life++;\n }\n if (life \u003c= 0) {\n stop();\n }\n if (ship.touched(food)) {\n food.x = 50 + Math.random() * 540;\n food.y = 50 + Math.random() * 380;\n score += 1;\n if (score % 10 == 0) {\n end = clock + 600;\n }\n sound.play('effect.wav');\n }\n for (var i = 0; i \u003c shadows.length; i++) {\n shadows[i].opacity -= 0.01;\n shadows[i].scale -= 0.01;\n shadows[i].direction += 2;\n if (shadows[i].opacity \u003c 0) {\n shadows[i].destroy();\n }\n }\n \n print(score, 10, 10, '#21ffff', 20);\n print(life, 10, 40, '#21ffff', 20);\n};","created_at":"2017-03-01T20:52:04.729+08:00","updated_at":"2020-03-23T23:05:42.593+08:00","name":"太空訓練_概念版","language":"javascript","screenshot":{"url":"https://cdn7.koding.school/uploads/project/screenshot/7311/a08ca7e7459648c56911dc39a68650ae.jpg"},"parent_id":7217,"plugin":"","description":"上、左、右推進火箭\n在料用盡前成功火箭降落在平台上。","note":null,"status":"public","like_student_ids":[172,109,74,3206,4689,4688,4695,4690,37,255,4675,2293,2004,1902,1911],"is_featured":false,"views":2618,"hashid":"vngs24r","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":1962376,"file_name":"flame.png","project_id":7311,"asset_id":170594,"created_at":"2019-12-17T15:51:15.074+08:00","updated_at":"2019-12-17T15:51:23.821+08:00"},{"id":1962360,"file_name":"ship.png","project_id":7311,"asset_id":172332,"created_at":"2019-12-17T14:24:26.199+08:00","updated_at":"2019-12-17T14:24:26.199+08:00"},{"id":1962361,"file_name":"food.png","project_id":7311,"asset_id":172333,"created_at":"2019-12-17T14:24:26.205+08:00","updated_at":"2019-12-17T14:24:26.205+08:00"},{"id":1962362,"file_name":"bullet.png","project_id":7311,"asset_id":172334,"created_at":"2019-12-17T14:24:26.210+08:00","updated_at":"2019-12-17T14:24:26.210+08:00"},{"id":1962375,"file_name":"bgm.mp3","project_id":7311,"asset_id":172346,"created_at":"2019-12-17T15:40:02.506+08:00","updated_at":"2019-12-17T15:40:02.506+08:00"},{"id":1962377,"file_name":"effect.wav","project_id":7311,"asset_id":172347,"created_at":"2019-12-17T16:03:15.518+08:00","updated_at":"2019-12-17T16:03:15.518+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦