{"id":154859,"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('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'); //目標\n\nvar vx = 0; //水平的移動速度\nvar vy = 0; //垂直的移動速度\nvar isStart = false; //是否開始\nvar fuel = 2000; //燃料\n\nplayer.layer = 1; //設定玩家圖層到最上層\n\nforever(loop); //重複不斷執行遊戲回圈\n\nvar offsetX = [1000, 1000, 200, 100, 1000, 1100, 1100, 750, 1150];\nvar offsetY = [800, 200, 800, 150, 200, 800, 100, 200, 730];\n\nbar.moveTo(244, 46);\n\n//遊戲主迴圈\nfunction loop () {\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/2 - 756;\n if (fuel % 2 == 0) createFlame();\n isStart = true;\n }\n \n if (isStart) {\n vy += 0.07;\n player.move(vx, vy);\n player.direction = 90 + vx*2; \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 1200 || player.y \u003e 900) {\n stop();\n print('GAME OVER!', 100, 100, 'red', 70); //要改成圖片\n }\n\n target.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//創造火焰球\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-02T15:33:36.784+08:00","updated_at":"2020-06-04T14:24:02.739+08:00","name":"太空人","language":"javascript","screenshot":{"url":"https://cdn3.koding.school/uploads/project/screenshot/154859/6ee65e26906e0e4d45496ca139e6b8f8.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":"882sgrne","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":2701116,"file_name":"1.png","project_id":154859,"asset_id":223316,"created_at":"2020-06-02T15:33:47.730+08:00","updated_at":"2020-06-02T15:33:47.730+08:00"},{"id":2701117,"file_name":"2.png","project_id":154859,"asset_id":223317,"created_at":"2020-06-02T15:33:47.732+08:00","updated_at":"2020-06-02T15:33:47.732+08:00"},{"id":2701118,"file_name":"3.png","project_id":154859,"asset_id":223318,"created_at":"2020-06-02T15:33:48.153+08:00","updated_at":"2020-06-02T15:33:48.153+08:00"},{"id":2701119,"file_name":"4.png","project_id":154859,"asset_id":223319,"created_at":"2020-06-02T15:33:48.155+08:00","updated_at":"2020-06-02T15:33:48.155+08:00"},{"id":2701132,"file_name":"flame.png","project_id":154859,"asset_id":223331,"created_at":"2020-06-02T15:51:38.783+08:00","updated_at":"2020-06-02T15:51:38.783+08:00"},{"id":2701120,"file_name":"5.png","project_id":154859,"asset_id":223320,"created_at":"2020-06-02T15:33:48.442+08:00","updated_at":"2020-06-02T15:33:48.442+08:00"},{"id":2701121,"file_name":"6.png","project_id":154859,"asset_id":223321,"created_at":"2020-06-02T15:33:48.443+08:00","updated_at":"2020-06-02T15:33:48.443+08:00"},{"id":2701122,"file_name":"7.png","project_id":154859,"asset_id":223322,"created_at":"2020-06-02T15:33:48.849+08:00","updated_at":"2020-06-02T15:33:48.849+08:00"},{"id":2701123,"file_name":"8.png","project_id":154859,"asset_id":223323,"created_at":"2020-06-02T15:33:48.851+08:00","updated_at":"2020-06-02T15:33:48.851+08:00"},{"id":2701124,"file_name":"9.png","project_id":154859,"asset_id":223324,"created_at":"2020-06-02T15:33:49.116+08:00","updated_at":"2020-06-02T15:33:49.116+08:00"},{"id":2701125,"file_name":"bar.png","project_id":154859,"asset_id":223325,"created_at":"2020-06-02T15:33:49.118+08:00","updated_at":"2020-06-02T15:33:49.118+08:00"},{"id":2701126,"file_name":"bg.jpg","project_id":154859,"asset_id":223326,"created_at":"2020-06-02T15:33:49.491+08:00","updated_at":"2020-06-02T15:33:49.491+08:00"},{"id":2701127,"file_name":"dashboard.png","project_id":154859,"asset_id":223327,"created_at":"2020-06-02T15:33:49.493+08:00","updated_at":"2020-06-02T15:33:49.493+08:00"},{"id":2701128,"file_name":"player.png","project_id":154859,"asset_id":223328,"created_at":"2020-06-02T15:33:49.775+08:00","updated_at":"2020-06-02T15:33:49.775+08:00"},{"id":2701129,"file_name":"target.png","project_id":154859,"asset_id":223329,"created_at":"2020-06-02T15:33:49.777+08:00","updated_at":"2020-06-02T15:33:49.777+08:00"},{"id":2701130,"file_name":"wall.png","project_id":154859,"asset_id":223330,"created_at":"2020-06-02T15:33:50.001+08:00","updated_at":"2020-06-02T15:33:50.001+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦