{"id":159357,"student_id":10,"content":"setBackdrop('bg.jpg');\n\nvar wall = createSprite('wall.png'); //牆壁\nvar bar = createSprite('bar.png'); //生命條\nvar dashboard = createSprite('dashboard.png'); //資訊版\nvar levels = createSprite('0.png', '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 text = createSprite('arrow.png', 'youwin.png', 'gameover.png'); //文字圖\n\nplayer.layer = 1; //設定玩家圖層到最上層\n\nvar vx = 0; //水平的移動速度\nvar vy = 0; //垂直的移動速度\nvar isStart = false; //是否開始\nvar fuel = 1000; //燃料\n\nforever(loop); //重複不斷執行遊戲回圈\n\nvar goalX = [1000, 1000, 200, 200, 1000, 1000, 1000, 600, 1100];\nvar goalY = [700, 200, 700, 200, 200, 700, 200, 450, 700];\n\nbar.moveTo(250, 46);\n\ncreateSound('bgm.mp3', true)\n\n//遊戲主迴圈\nfunction loop () {\n \n if (isStart) {\n vy += 0.07;\n player.move(vx, vy);\n player.direction = 90 + vx*2;\n text.hidden = true;\n }\n \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 \n if (key.right || key.left || key.up) {\n fuel -= 1;\n bar.x = (fuel/1000)*500 - 250;\n if (fuel % 2 == 0) createFlame();\n isStart = true;\n }\n \n //根據關卡調整木\n target.x = goalX[levels.costumeId];\n target.y = goalY[levels.costumeId];\n \n if (levels.costumeId == 9) {\n stop();\n text.hidden = false;\n text.costumeId = 1;\n }\n if (player.touched(levels)) {\n stop();\n text.hidden = false;\n text.costumeId = 2;\n }\n\n target.direction += 1;\n if (player.touched(target)) {\n levels.costumeId++;\n fuel = 1000;\n createSound('effect.wav')\n }\n}\n\n//創造火焰球\nfunction createFlame () {\n var f = createSprite('flame.png');\n f.moveTo(player);\n f.direction = player.direction + 90 + Math.random()*30 - 15;\n f.stepForward(50);\n \n f.forever(function () {\n f.stepForward(5);\n f.opacity -= 0.01;\n f.scale -= 0.01;\n if (f.opacity \u003c 0) f.destroy();\n });\n}","created_at":"2020-06-15T09:28:34.994+08:00","updated_at":"2021-03-31T16:03:43.990+08:00","name":"太空人(完整版)","language":"javascript","screenshot":{"url":"https://cdn9.koding.school/uploads/project/screenshot/159357/89edcce60b8890776f43b51e69f48ea4.jpg"},"parent_id":155346,"plugin":"Game.set({width: 1200, height: 900})","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":238,"hashid":"ej9s46wq","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":3116552,"file_name":"8.png","project_id":159357,"asset_id":251420,"created_at":"2020-08-20T14:54:34.029+08:00","updated_at":"2020-08-20T14:54:34.029+08:00"},{"id":3116553,"file_name":"9.png","project_id":159357,"asset_id":251421,"created_at":"2020-08-20T14:54:34.031+08:00","updated_at":"2020-08-20T14:54:34.031+08:00"},{"id":3116554,"file_name":"arrow.png","project_id":159357,"asset_id":251412,"created_at":"2020-08-20T14:54:34.670+08:00","updated_at":"2020-08-20T14:54:34.670+08:00"},{"id":3116555,"file_name":"bar.png","project_id":159357,"asset_id":251422,"created_at":"2020-08-20T14:54:34.671+08:00","updated_at":"2020-08-20T14:54:34.671+08:00"},{"id":3116558,"file_name":"flame.png","project_id":159357,"asset_id":251425,"created_at":"2020-08-20T14:54:35.863+08:00","updated_at":"2020-08-20T14:54:35.863+08:00"},{"id":3116559,"file_name":"gameover.png","project_id":159357,"asset_id":251426,"created_at":"2020-08-20T14:54:35.864+08:00","updated_at":"2020-08-20T14:54:35.864+08:00"},{"id":3116560,"file_name":"player.png","project_id":159357,"asset_id":251427,"created_at":"2020-08-20T14:54:36.519+08:00","updated_at":"2020-08-20T14:54:36.519+08:00"},{"id":3116561,"file_name":"target.png","project_id":159357,"asset_id":251428,"created_at":"2020-08-20T14:54:36.521+08:00","updated_at":"2020-08-20T14:54:36.521+08:00"},{"id":3116544,"file_name":"0.png","project_id":159357,"asset_id":251412,"created_at":"2020-08-20T14:54:31.075+08:00","updated_at":"2020-08-20T14:54:31.075+08:00"},{"id":3116545,"file_name":"1.png","project_id":159357,"asset_id":251413,"created_at":"2020-08-20T14:54:31.077+08:00","updated_at":"2020-08-20T14:54:31.077+08:00"},{"id":3116564,"file_name":"effect.wav","project_id":159357,"asset_id":172348,"created_at":"2020-08-20T14:55:51.143+08:00","updated_at":"2020-08-20T14:55:51.143+08:00"},{"id":3116566,"file_name":"bgm.mp3","project_id":159357,"asset_id":246649,"created_at":"2020-08-20T14:55:51.983+08:00","updated_at":"2020-08-20T14:55:51.983+08:00"},{"id":3116562,"file_name":"wall.png","project_id":159357,"asset_id":251421,"created_at":"2020-08-20T14:54:37.178+08:00","updated_at":"2020-08-20T14:54:37.178+08:00"},{"id":3116563,"file_name":"youwin.png","project_id":159357,"asset_id":251429,"created_at":"2020-08-20T14:54:37.180+08:00","updated_at":"2020-08-20T14:54:37.180+08:00"},{"id":3116565,"file_name":"coin.wav","project_id":159357,"asset_id":246652,"created_at":"2020-08-20T14:55:51.802+08:00","updated_at":"2020-08-20T14:55:51.802+08:00"},{"id":3116548,"file_name":"4.png","project_id":159357,"asset_id":251416,"created_at":"2020-08-20T14:54:32.718+08:00","updated_at":"2020-08-20T14:54:32.718+08:00"},{"id":3116549,"file_name":"5.png","project_id":159357,"asset_id":251417,"created_at":"2020-08-20T14:54:32.719+08:00","updated_at":"2020-08-20T14:54:32.719+08:00"},{"id":3116550,"file_name":"6.png","project_id":159357,"asset_id":251418,"created_at":"2020-08-20T14:54:33.483+08:00","updated_at":"2020-08-20T14:54:33.483+08:00"},{"id":3116551,"file_name":"7.png","project_id":159357,"asset_id":251419,"created_at":"2020-08-20T14:54:33.484+08:00","updated_at":"2020-08-20T14:54:33.484+08:00"},{"id":3116556,"file_name":"bg.jpg","project_id":159357,"asset_id":251423,"created_at":"2020-08-20T14:54:35.324+08:00","updated_at":"2020-08-20T14:54:35.324+08:00"},{"id":3116557,"file_name":"dashboard.png","project_id":159357,"asset_id":251424,"created_at":"2020-08-20T14:54:35.325+08:00","updated_at":"2020-08-20T14:54:35.325+08:00"},{"id":3116546,"file_name":"2.png","project_id":159357,"asset_id":251414,"created_at":"2020-08-20T14:54:31.799+08:00","updated_at":"2020-08-20T14:54:31.799+08:00"},{"id":3116547,"file_name":"3.png","project_id":159357,"asset_id":251415,"created_at":"2020-08-20T14:54:31.801+08:00","updated_at":"2020-08-20T14:54:31.801+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦