{"id":61712,"student_id":10,"content":"setBackdrop('black');\nvar obstacle = 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\n// player.moveTo(50, 50);\ntarget.moveTo(500, 400);\n\nvar vx = 0;\nvar vy = 0;\nvar level = 0;\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(function(){\n \n target.direction += 1;\n player.direction = 90 + vx*5;\n\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 vy += 0.03;\n player.move(vx, vy);\n \n if (player.touched(target)) {\n obstacle.costumeId++;\n level++;\n }\n \n // 這個專案可以用來介紹陣列以及改寫的好處\n target.x = offsetX[level];\n target.y = offsetY[level];\n // if (level == 1) {\n // target.moveTo(500, 100);\n // }\n // if (level == 2) {\n // target.moveTo(100, 450);\n // }\n // if (level == 3) {\n // target.moveTo(50, 75);\n // }\n // if (level == 4) {\n // target.moveTo(500, 100);\n // }\n // if (level == 5) {\n // target.moveTo(550, 400);\n // }\n // if (level == 6) {\n // target.moveTo(550, 50);\n // }\n // if (level == 7) {\n // target.moveTo(375, 100);\n // }\n // if (level == 8) {\n // target.moveTo(575, 365);\n // }\n if (level == 9) {\n stop();\n print('YOU WIN!', 100, 100, 'gold', 70);\n }\n if (player.touched(obstacle) || 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","created_at":"2019-04-07T18:18:35.552+08:00","updated_at":"2020-05-20T13:13:45.216+08:00","name":"太空人探險_概念版","language":"javascript","screenshot":{"url":"/uploads/project/screenshot/61712/498e4a26f383739800cb82c969037884.jpg"},"parent_id":17200,"plugin":"\n\nlet _counter = 0;\nforever(function(){\n _counter++;\n if(_counter%4 != 0) return;\n \n if (window.player \u0026\u0026 (key.right || key.left || key.up)) {\n \n let f = createSprite('flame.png');\n f.moveTo(player);\n f.layer = -1;\n f.direction = player.direction - 90 + 180 + Math.random()*30 - 15;\n f.stepForward(30);\n f.forever(() =\u003e {\n f.scale -= 0.01;\n f.opacity = f.scale;\n f.stepForward(3);\n if (f.scale \u003c 0) {\n f.destroy();\n }\n });\n }\n});","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":506,"hashid":"rdvsz5qy","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":1084943,"file_name":"target.png","project_id":61712,"asset_id":40425,"created_at":"2019-04-07T18:18:35.557+08:00","updated_at":"2019-04-07T18:18:35.557+08:00"},{"id":1084954,"file_name":"circle.png","project_id":61712,"asset_id":40414,"created_at":"2019-04-07T18:18:35.570+08:00","updated_at":"2019-04-07T18:18:35.570+08:00"},{"id":1084955,"file_name":"flame.png","project_id":61712,"asset_id":40413,"created_at":"2019-04-07T18:18:35.571+08:00","updated_at":"2019-04-07T18:18:35.571+08:00"},{"id":1084944,"file_name":"player.png","project_id":61712,"asset_id":40424,"created_at":"2019-04-07T18:18:35.559+08:00","updated_at":"2019-12-16T11:50:01.303+08:00"},{"id":1084953,"file_name":"7.png","project_id":61712,"asset_id":40415,"created_at":"2019-04-07T18:18:35.569+08:00","updated_at":"2019-12-16T11:50:08.657+08:00"},{"id":1084952,"file_name":"1.png","project_id":61712,"asset_id":40416,"created_at":"2019-04-07T18:18:35.568+08:00","updated_at":"2019-12-16T11:50:11.726+08:00"},{"id":1084951,"file_name":"2.png","project_id":61712,"asset_id":40417,"created_at":"2019-04-07T18:18:35.567+08:00","updated_at":"2019-12-16T11:50:14.174+08:00"},{"id":1084950,"file_name":"3.png","project_id":61712,"asset_id":40418,"created_at":"2019-04-07T18:18:35.565+08:00","updated_at":"2019-12-16T11:50:17.421+08:00"},{"id":1084949,"file_name":"4.png","project_id":61712,"asset_id":40419,"created_at":"2019-04-07T18:18:35.564+08:00","updated_at":"2019-12-16T11:50:18.960+08:00"},{"id":1084948,"file_name":"5.png","project_id":61712,"asset_id":40420,"created_at":"2019-04-07T18:18:35.563+08:00","updated_at":"2019-12-16T11:50:20.343+08:00"},{"id":1084947,"file_name":"6.png","project_id":61712,"asset_id":40421,"created_at":"2019-04-07T18:18:35.562+08:00","updated_at":"2019-12-16T11:50:22.534+08:00"},{"id":1084946,"file_name":"8.png","project_id":61712,"asset_id":40422,"created_at":"2019-04-07T18:18:35.561+08:00","updated_at":"2019-12-16T11:50:27.234+08:00"},{"id":1084945,"file_name":"9.png","project_id":61712,"asset_id":40423,"created_at":"2019-04-07T18:18:35.560+08:00","updated_at":"2019-12-16T11:50:31.481+08:00"}]
Orange Apple Learning Platform
My Projects
View Project Page
Export
Remix
Import
Delete
Download Android APP (APK)
Screenshot
繁中
简中
English
日本語
1:1:1
1:1
Full Width
Scan the QRCode below with your phone to install
Or you can
download APK
to this computer
Scan the QRCode below with your phone to install
Or you can
download APK
to this computer