{"id":204369,"student_id":12205,"content":"setBackdrop('black');\nvar levels = createSprite('1.png', '2.png', '3.png', '4.png','6.png', '5.png', '7.png', '8.png', '9.png');\nvar player = createSprite('player.png');\nvar target = createSprite('targe.png');\n\nvar vx = 0;\nvar vy = 0;\nvar volume = 0;\nvar isStart = false;\n\nplayer.moveTo(50, 50);\ntarget.moveTo(500, 400);\n\n//'4.png','6.png',target.png\n\n\n// 後面章節改寫成陣列來精簡程式碼\nvar offsetX = [500, 500, 100, 50, 500, 550, 550, 375, 575];\nvar offsetY = [400, 100, 450, 75, 100, 400, 50, 100, 365];\n\nforever(loop);\n\nfunction loop () {\n if (key.right) {\n vx += 0.05;\n }\n if (key.left) {\n vx -= 0.05;\n }\n if (key.up) {\n vy -= 0.07;\n }\n if (key.right || key.left || key.up) {\n isStart = true;\n } else {\n \n }\n if (isStart) {\n vy += 0.03;\n player.move(vx, vy);\n player.direction = 90 + vx*5;\n }\n \n if (player.touched(target)) {\n levels.costumeId++;\n }\n\n target.direction += 1;\n // 這個專案可以用來介紹陣列以及改寫的好處\n target.x = offsetX[levels.costumeId];\n target.y = offsetY[levels.costumeId];\n // if (levels.costumeId == 1) {\n // target.moveTo(500, 100);\n // }\n // if (levels.costumeId == 2) {\n // target.moveTo(100, 450);\n // }\n // if (levels.costumeId == 3) {\n // target.moveTo(50, 75);\n // }\n // if (levels.costumeId == 4) {\n // target.moveTo(500, 100);\n // }\n // if (levels.costumeId == 5) {\n // target.moveTo(550, 400);\n // }\n // if (levels.costumeId == 6) {\n // target.moveTo(550, 50);\n // }\n // if (levels.costumeId == 7) {\n // target.moveTo(375, 100);\n // }\n // if (levels.costumeId == 8) {\n // target.moveTo(575, 365);\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 if ((key.up || key.right || key.left) \u0026\u0026 volume \u003c 1) {\n volume += 0.05;\n }\n else if (volume \u003e 0.05) {\n volume -= 0.05;\n }\n \n}","created_at":"2020-11-14T16:04:19.453+08:00","updated_at":"2020-11-27T20:21:23.930+08:00","name":"太空人探險_概念版 副本","language":"javascript","screenshot":{"url":"https://cdn6.koding.school/uploads/project/screenshot/204369/ae85e73317c47852efd54c1c3b611769.jpg"},"parent_id":11631,"plugin":"\n\n","description":null,"note":null,"status":"public","like_student_ids":[12205],"is_featured":false,"views":48,"hashid":"gk4skkkwe","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":3538465,"file_name":"fire.ogg","project_id":204369,"asset_id":172575,"created_at":"2020-11-14T16:04:19.459+08:00","updated_at":"2020-11-14T16:04:19.459+08:00"},{"id":3538466,"file_name":"bgm.mp3","project_id":204369,"asset_id":172574,"created_at":"2020-11-14T16:04:19.461+08:00","updated_at":"2020-11-14T16:04:19.461+08:00"},{"id":3538468,"file_name":"player.png","project_id":204369,"asset_id":172572,"created_at":"2020-11-14T16:04:19.463+08:00","updated_at":"2020-11-14T16:04:19.463+08:00"},{"id":3538469,"file_name":"8.png","project_id":204369,"asset_id":172571,"created_at":"2020-11-14T16:04:19.464+08:00","updated_at":"2020-11-14T16:04:19.464+08:00"},{"id":3538470,"file_name":"6.png","project_id":204369,"asset_id":172570,"created_at":"2020-11-14T16:04:19.465+08:00","updated_at":"2020-11-14T16:04:19.465+08:00"},{"id":3538471,"file_name":"5.png","project_id":204369,"asset_id":172569,"created_at":"2020-11-14T16:04:19.466+08:00","updated_at":"2020-11-14T16:04:19.466+08:00"},{"id":3538472,"file_name":"4.png","project_id":204369,"asset_id":172568,"created_at":"2020-11-14T16:04:19.467+08:00","updated_at":"2020-11-14T16:04:19.467+08:00"},{"id":3538473,"file_name":"3.png","project_id":204369,"asset_id":172567,"created_at":"2020-11-14T16:04:19.468+08:00","updated_at":"2020-11-14T16:04:19.468+08:00"},{"id":3538474,"file_name":"2.png","project_id":204369,"asset_id":172566,"created_at":"2020-11-14T16:04:19.469+08:00","updated_at":"2020-11-14T16:04:19.469+08:00"},{"id":3538475,"file_name":"1.png","project_id":204369,"asset_id":172565,"created_at":"2020-11-14T16:04:19.470+08:00","updated_at":"2020-11-14T16:04:19.470+08:00"},{"id":3538476,"file_name":"7.png","project_id":204369,"asset_id":172564,"created_at":"2020-11-14T16:04:19.471+08:00","updated_at":"2020-11-14T16:04:19.471+08:00"},{"id":3538477,"file_name":"circle.png","project_id":204369,"asset_id":172563,"created_at":"2020-11-14T16:04:19.472+08:00","updated_at":"2020-11-14T16:04:19.472+08:00"},{"id":3538478,"file_name":"flame.png","project_id":204369,"asset_id":172562,"created_at":"2020-11-14T16:04:19.473+08:00","updated_at":"2020-11-14T16:04:19.473+08:00"},{"id":3538479,"file_name":"9.png","project_id":204369,"asset_id":172561,"created_at":"2020-11-14T16:04:19.474+08:00","updated_at":"2020-11-14T16:04:19.474+08:00"},{"id":3595968,"file_name":"target.png","project_id":204369,"asset_id":38820,"created_at":"2020-11-27T20:22:10.856+08:00","updated_at":"2020-11-27T20:22:10.856+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦