{"id":17355,"student_id":1769,"content":"setBackdrop('#000000');\nvar ship = createSprite(\"ship.png\");\nvar bullets = [];\nvar clock = 0;\nvar score = 0;\n\nvar food = createSprite(\"food.png\");\nfood.x = Math.random() * 640;\nfood.y = Math.random() * 480;\n\nforever(function () {\n ship.toward(cursor);\n ship.stepForward(5);\n \n clock++; //clock += 1;\n\n if(clock % 3 == 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\n for(var i = 0; i \u003c bullets.length; i++){\n if(bullets[i].touched(ship)){\n print(\"game over\", 200, 200, \"white\", 50);\n stop();\n }\n bullets[i].stepForward(2);\n }\n\n if(ship.touched(food)){\n score += 1;\n food.x = Math.random() * 640;\n food.y = Math.random() * 480; \n }\n \n print(\"分數\"+score, 72, 55, \"red\", 30);\n \n});","created_at":"2017-03-01T20:52:04.729+08:00","updated_at":"2019-11-04T17:21:51.065+08:00","name":"太空訓練","language":"javascript","screenshot":{"url":"https://cdn3.koding.school/uploads/project/screenshot/17355/6502c7dff4f6d621202faed056d1cc49.jpg"},"parent_id":10707,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":91,"hashid":"jzmse2nd","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":354223,"file_name":"bullet.png","project_id":17355,"asset_id":28733,"created_at":"2017-12-09T10:18:54.724+08:00","updated_at":"2017-12-09T10:18:54.724+08:00"},{"id":354224,"file_name":"food.png","project_id":17355,"asset_id":28734,"created_at":"2017-12-09T10:18:54.726+08:00","updated_at":"2017-12-09T10:18:54.726+08:00"},{"id":354225,"file_name":"ship.png","project_id":17355,"asset_id":28735,"created_at":"2017-12-09T10:18:54.729+08:00","updated_at":"2017-12-09T10:18:54.729+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦