{"id":144117,"student_id":10,"content":"setBackdrop('black');\nvar bar = createSprite('bar.png');\nvar dashboard = createSprite('dashboard.png');\nvar levels = createSprite('1.png', '2.png', '3.png', '4.png', '5.png', '6.png', '7.png', '8.png', '9.png')\nvar player = createSprite('player.png');\nvar target = createSprite('target.png');\nvar target2 = createSprite('target.png');\n\nvar vx = 0;\nvar vy = 0;\nvar isStart = false;\nvar fuel = 1000;\n\nvar offsetX = [1000, 1000, 200, 100, 1000, 1100, 1100, 750, 1150];\nvar offsetY = [800, 200, 900, 150, 200, 800, 100, 200, 730];\n\nplayer.moveTo(100, 100);\ntarget.moveTo(1000, 800);\n\ntarget2.scale = 0.5;\n\nforever(loop);\n\nfunction loop () {\n vy += 0.07;\n if (key.up \u0026\u0026 fuel \u003e 0) {\n vy -= 0.15;\n }\n if (key.right \u0026\u0026 fuel \u003e 0) {\n vx += 0.1;\n }\n if (key.left \u0026\u0026 fuel \u003e 0) {\n vx -= 0.1;\n }\n if (key.right || key.left || key.up) {\n fuel -= 1;\n bar.x = fuel - 500;\n }\n\n player.move(vx, vy);\n\n // 這個章節可以用來介紹陣列以及改寫的好處\n target.x = offsetX[levels.costumeId];\n target.y = offsetY[levels.costumeId];\n \n if (levels.costumeId == 9) {\n stop();\n print('YOU WIN!', 100, 100, 'gold', 70);\n }\n if (player.touched(levels) || player.x \u003c 0 || player.y \u003c 0 || player.x \u003e 640 || player.y \u003e 480) {\n stop();\n print('GAME OVER!', 100, 100, 'red', 70);\n }\n\n target2.x = target.x;\n target2.y = target.y;\n\n target.direction += 1;\n target2.direction -= 1;\n if (player.touched(target)) {\n levels.costumeId++;\n fuel = 1000;\n }\n\n drawText(fuel, 100, 50, 'black', 30);\n drawText(levels.costumeId + '/10', 1100, 50, 'black', 30);\n}\n\n","created_at":"2020-04-28T14:19:26.469+08:00","updated_at":"2020-06-02T15:41:09.752+08:00","name":"太空人","language":"javascript","screenshot":{"url":"https://cdn1.koding.school/uploads/project/screenshot/144117/c898058d1ba9684594f2563b21324b8f.jpg"},"parent_id":2,"plugin":"Game.set({width: 1200, height: 900});","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":247,"hashid":"4y3s85m8","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":2493600,"file_name":"5.png","project_id":144117,"asset_id":209226,"created_at":"2020-04-28T14:19:50.753+08:00","updated_at":"2020-04-28T14:19:50.753+08:00"},{"id":2493601,"file_name":"6.png","project_id":144117,"asset_id":209227,"created_at":"2020-04-28T14:19:50.755+08:00","updated_at":"2020-04-28T14:19:50.755+08:00"},{"id":2493605,"file_name":"player.png","project_id":144117,"asset_id":209231,"created_at":"2020-04-28T14:20:14.770+08:00","updated_at":"2020-04-28T14:20:14.770+08:00"},{"id":2493596,"file_name":"1.png","project_id":144117,"asset_id":209222,"created_at":"2020-04-28T14:19:48.881+08:00","updated_at":"2020-04-28T14:19:48.881+08:00"},{"id":2493597,"file_name":"2.png","project_id":144117,"asset_id":209223,"created_at":"2020-04-28T14:19:48.883+08:00","updated_at":"2020-04-28T14:19:48.883+08:00"},{"id":2493609,"file_name":"bar.png","project_id":144117,"asset_id":209235,"created_at":"2020-04-28T15:07:15.307+08:00","updated_at":"2020-04-28T15:07:15.307+08:00"},{"id":2493602,"file_name":"7.png","project_id":144117,"asset_id":209228,"created_at":"2020-04-28T14:19:52.403+08:00","updated_at":"2020-04-28T14:19:52.403+08:00"},{"id":2493603,"file_name":"8.png","project_id":144117,"asset_id":209229,"created_at":"2020-04-28T14:19:52.405+08:00","updated_at":"2020-04-28T14:19:52.405+08:00"},{"id":2493604,"file_name":"9.png","project_id":144117,"asset_id":209230,"created_at":"2020-04-28T14:20:10.210+08:00","updated_at":"2020-04-28T14:20:10.210+08:00"},{"id":2493607,"file_name":"dashboard.png","project_id":144117,"asset_id":209233,"created_at":"2020-04-28T15:06:50.370+08:00","updated_at":"2020-04-28T15:06:50.370+08:00"},{"id":2493598,"file_name":"3.png","project_id":144117,"asset_id":209224,"created_at":"2020-04-28T14:19:49.407+08:00","updated_at":"2020-04-28T14:19:49.407+08:00"},{"id":2493599,"file_name":"4.png","project_id":144117,"asset_id":209225,"created_at":"2020-04-28T14:19:49.409+08:00","updated_at":"2020-04-28T14:19:49.409+08:00"},{"id":2493606,"file_name":"target.png","project_id":144117,"asset_id":209232,"created_at":"2020-04-28T14:48:07.946+08:00","updated_at":"2020-04-28T14:48:07.946+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦