{"id":116395,"student_id":10,"content":"setBackdrop('black');\nsound.play('bgm.mp3', true);\nvar ship = createSprite(\"ship.png\");\nvar food = createSprite(\"food.png\");\nfood.x = 50 + Math.random() * 540;\nfood.y = 50 + Math.random() * 380;\nfood.direction = Math.random() * 3\nship.layer = 1;\n\nvar shadows = [];\nvar bullets = [];\nvar score = 0;\nvar clock = 0;\n\nforever(function () {\n var speed = ship.distanceTo(cursor)/20;\n ship.toward(cursor);\n ship.stepForward(speed);\n \n food.stepForward(3);\n food.bounceEdge();\n\n clock ++;\n if (clock%2 == 0) {\n var bullet = createSprite('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 if (bullets[i].distanceTo(320, 240) \u003e 500) {\n bullets[i].destroy();\n }\n bullets[i].stepForward(2);\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 if (ship.touched(bullets)) {\n stop();\n }\n if (ship.touched(food)) {\n food.x = 50 + Math.random() * 540;\n food.y = 50 + Math.random() * 380;\n food.direction = Math.random() * 360;\n score += 1;\n sound.play('effect.wav');\n }\n print(score, 10, 10, '#21ffff', 20);\n});","created_at":"2019-12-27T18:44:08.920+08:00","updated_at":"2020-02-17T12:35:16.182+08:00","name":"太空訓練_概念版 副本","language":"javascript","screenshot":{"url":"https://cdn4.koding.school/uploads/project/screenshot/116395/2c806826d23248fff90fddbf3495c1ee.jpg"},"parent_id":7311,"plugin":"","description":"上、左、右推進火箭\n在料用盡前成功火箭降落在平台上。","note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":253,"hashid":"rdvsrjq5","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":1993853,"file_name":"effect.wav","project_id":116395,"asset_id":172347,"created_at":"2019-12-27T18:44:08.930+08:00","updated_at":"2019-12-27T18:44:08.930+08:00"},{"id":1993854,"file_name":"flame.png","project_id":116395,"asset_id":170594,"created_at":"2019-12-27T18:44:09.364+08:00","updated_at":"2019-12-27T18:44:09.364+08:00"},{"id":1993855,"file_name":"bgm.mp3","project_id":116395,"asset_id":172346,"created_at":"2019-12-27T18:44:09.367+08:00","updated_at":"2019-12-27T18:44:09.367+08:00"},{"id":1993856,"file_name":"bullet.png","project_id":116395,"asset_id":172334,"created_at":"2019-12-27T18:44:09.369+08:00","updated_at":"2019-12-27T18:44:09.369+08:00"},{"id":1993857,"file_name":"food.png","project_id":116395,"asset_id":172333,"created_at":"2019-12-27T18:44:09.372+08:00","updated_at":"2019-12-27T18:44:09.372+08:00"},{"id":1993858,"file_name":"ship.png","project_id":116395,"asset_id":172332,"created_at":"2019-12-27T18:44:09.374+08:00","updated_at":"2019-12-27T18:44:09.374+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦