{"id":219034,"student_id":3769,"content":"setBackdrop('black');\n\n// 創造天花板\nvar ceiling = createSprite(\"ceiling.png\");\nceiling.x = 320;\nceiling.y = 8;\nceiling.layer = 1;\n\n// 創造左右牆壁\nvar left_wall = createSprite(\"wall.png\");\nvar right_wall = createSprite(\"wall.png\");\nleft_wall.x = 130;\nright_wall.x = 510;\n\n// 創造玩家\nvar player = createSprite([\"player_1.png\", \"player_2.png\", \"player_3.png\", \"player_4.png\", \"player_5.png\"]);\nplayer.y = 50;\n\n// 初始化變數\nvar life = 10;\nvar floor = 0;\nvar vy = 0;\nvar stairs = []\nvar hit = false;\nvar clock = 0;\n\nfor (var i = 0; i \u003c 8; i ++) {\n var stair = createSprite([\"conveyor_left.png\", \"conveyor_right.png\", \"normal.png\", \"nails.png\", \"trampoline.png\", \"fake.png\"])\n stair.costumeId = Math.floor(Math.random()*6);\n stair.x = Math.random()* 250 + 200\n stair.y = i * 80 + 550;\n stairs.push(stair);\n}\n\n\nforever(function() {\n if (life \u003e 0 \u0026\u0026 player.y \u003c 480) {\n updateplayer();\n updatestairs();\n flashbackground();\n checktouchedceiling();\n updateCostume();\n setBackdrop('black');\n } else {\n\n setBackdrop('red');\n print('game over', 200, 200, 'white', 30)\n }\n print('分數:' + floor, 10, 10, 'white', 20);\n print('生命:' + life, 10, 40, 'while', 20);\n\n});\n\nfunction updateplayer() {\n if (key.left \u0026\u0026 !player.touched(left_wall)) {\n player.x -= 3;\n }\n if (key.right \u0026\u0026 !player.touched(right_wall)) {\n player.x += 3;\n }\n\n vy += 0.1;\n player.y += vy;\n}\n\nfunction updatestairs() {\n for (var i = 0; i \u003c stairs.length; i ++) {\n stairs[i]. y -= 2;\n if (stairs[i].y \u003c - 10) {\n stairs[i].costumeId = Math.floor(Math.random()*6);\n stairs[i].y += 640;\n stairs[i].hidden = false;\n floor += 1;\n }\n }\n}\n\nvar time = 0\nvar lastime = 0\nfunction checktouchedceiling() {\n time = Date.now();\n if (player.touched(ceiling) \u0026\u0026 time - lastime \u003e 3000) {\n life -= 3;\n vy = 0;\n lastime = time;\n hit = true;\n }\n}\n\nfunction flashbackground() {\n if (hit) {\n setBackdrop('red');\n hit = false;\n }\n}\nvar touchOn;\nplayer.when('touch', stairs, function (s) {\n vy = 0;\n player.y = s.y - 20;\n\n if (s.costumeId == 0) {\n player.x -= 2;\n }\n if (s.costumeId == 1) {\n player.x += 2;\n }\n if (s.costumeId == 4) {\n vy = -6;\n }\n if (s.costumeId == 2 \u0026\u0026 s != touchOn) {\n life += 1;\n }\n if (s.costumeId == 3 \u0026\u0026 s != touchOn) {\n life -= 3;\n }\n if (s.costumeId == 5) {\n setTimeout(function() {\n s.hidden = true\n }, 300);\n }\n touchOn = s;\n});\n\nfunction updateCostume() {\n clock += 1;\n if (clock % 3 == 0) {\n if (key.right) {\n if (player.costumeId == 1) {\n player.costumeId = 2;\n } else {\n player.costumeId = 0;\n }\n } else if (key.left) {\n if (player.costumeId == 3) {\n player.costumeId = 4;\n } else {\n player.costumeId = 3;\n }\n } else player.costumeId = 0;\n }\n}","created_at":"2021-01-16T10:21:04.998+08:00","updated_at":"2021-01-23T11:42:15.218+08:00","name":"小朋友下樓梯 副本","language":"javascript","screenshot":{"url":"https://cdn6.koding.school/uploads/project/screenshot/219034/89edcce60b8890776f43b51e69f48ea4.jpg"},"parent_id":61784,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":48,"hashid":"2pds9rzjp","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":3875681,"file_name":"jump.mp3","project_id":219034,"asset_id":114018,"created_at":"2021-01-16T10:21:05.004+08:00","updated_at":"2021-01-16T10:21:05.004+08:00"},{"id":3875682,"file_name":"gg.mp3","project_id":219034,"asset_id":114019,"created_at":"2021-01-16T10:21:05.006+08:00","updated_at":"2021-01-16T10:21:05.006+08:00"},{"id":3875683,"file_name":"flash.mp3","project_id":219034,"asset_id":114020,"created_at":"2021-01-16T10:21:05.007+08:00","updated_at":"2021-01-16T10:21:05.007+08:00"},{"id":3875684,"file_name":"bg.mp3","project_id":219034,"asset_id":114021,"created_at":"2021-01-16T10:21:05.008+08:00","updated_at":"2021-01-16T10:21:05.008+08:00"},{"id":3875685,"file_name":"player_1.png","project_id":219034,"asset_id":114022,"created_at":"2021-01-16T10:21:05.009+08:00","updated_at":"2021-01-16T10:21:05.009+08:00"},{"id":3875686,"file_name":"player_5.png","project_id":219034,"asset_id":114023,"created_at":"2021-01-16T10:21:05.010+08:00","updated_at":"2021-01-16T10:21:05.010+08:00"},{"id":3875687,"file_name":"player_2.png","project_id":219034,"asset_id":114024,"created_at":"2021-01-16T10:21:05.011+08:00","updated_at":"2021-01-16T10:21:05.011+08:00"},{"id":3875688,"file_name":"player_4.png","project_id":219034,"asset_id":114025,"created_at":"2021-01-16T10:21:05.012+08:00","updated_at":"2021-01-16T10:21:05.012+08:00"},{"id":3875689,"file_name":"player_3.png","project_id":219034,"asset_id":114026,"created_at":"2021-01-16T10:21:05.013+08:00","updated_at":"2021-01-16T10:21:05.013+08:00"},{"id":3875690,"file_name":"wall.png","project_id":219034,"asset_id":114027,"created_at":"2021-01-16T10:21:05.014+08:00","updated_at":"2021-01-16T10:21:05.014+08:00"},{"id":3875691,"file_name":"ceiling.png","project_id":219034,"asset_id":114028,"created_at":"2021-01-16T10:21:05.015+08:00","updated_at":"2021-01-16T10:21:05.015+08:00"},{"id":3875692,"file_name":"nails.png","project_id":219034,"asset_id":114029,"created_at":"2021-01-16T10:21:05.016+08:00","updated_at":"2021-01-16T10:21:05.016+08:00"},{"id":3875693,"file_name":"trampoline.png","project_id":219034,"asset_id":114030,"created_at":"2021-01-16T10:21:05.017+08:00","updated_at":"2021-01-16T10:21:05.017+08:00"},{"id":3875694,"file_name":"normal.png","project_id":219034,"asset_id":114031,"created_at":"2021-01-16T10:21:05.018+08:00","updated_at":"2021-01-16T10:21:05.018+08:00"},{"id":3875695,"file_name":"fake.png","project_id":219034,"asset_id":114032,"created_at":"2021-01-16T10:21:05.019+08:00","updated_at":"2021-01-16T10:21:05.019+08:00"},{"id":3875696,"file_name":"conveyor_right.png","project_id":219034,"asset_id":114033,"created_at":"2021-01-16T10:21:05.019+08:00","updated_at":"2021-01-16T10:21:05.019+08:00"},{"id":3875697,"file_name":"conveyor_left.png","project_id":219034,"asset_id":114034,"created_at":"2021-01-16T10:21:05.020+08:00","updated_at":"2021-01-16T10:21:05.020+08:00"}]
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
繁中
简中
English
日本語
1:1:1
1:1
全寬
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦