{"id":68725,"student_id":1940,"content":"setBackdrop('black');\n\n// 創造天花板\nvar ceiling = createSprite(\"ceiling.png\");\nceiling.x = 320;\nceiling.y = 8;\nceiling.layer = 1;\nvar vy = 0\nvar floor = 0\nvar health = 10\nvar score = 0\nvar touchOn\nvar time = 0\nvar lastTime = 0\nvar hit\nvar clock = 0\n// 創造左右牆壁\nvar left_wall = createSprite(\"wall.png\");\nvar right_wall = createSprite(\"wall.png\");\nleft_wall.x = 130;\nright_wall.x = 510;\n\n// 創造玩家\nvar stairs = []\nvar player = createSprite([\"player_1.png\", \"player_2.png\", \"player_3.png\", \"player_4.png\", \"player_5.png\"]);\nplayer.y = 50;\nfor (var i = 0; i \u003c 9; i++) {\n var stair = createSprite([\"nails.png\", \"trampoline.png\", \"normal.png\", \"fake.png\", \"conveyor_right.png\", \"conveyor_left.png\"])\n stair.costumeId = Math.floor(Math.random()*6)\n stair.x = Math.random()*250 + 200\n stair.y = i*80 + 550\n\n stairs.push(stair)\n}\nforever(function() {\n if (health \u003e 0 \u0026\u0026 player.y \u003c 480) {\n updaeplayer()\n updateStairs()\n checkTouchedCeiling()\n flashBackground()\n updateCostume()\n setBackdrop('black')\n } else f\n print('Score:' + time, 10, 10, 'white', 20)\n print('Health:' + health, 10, 40, 'white', 20)\n\n})\n\nfunction updaeplayer() {\n if (key.right \u0026\u0026 !player.touched(right_wall)) {\n player.x += 3\n }\n if (key.left \u0026\u0026 !player.touched(left_wall)) {\n player.x -= 3\n }\n vy += 0.1\n player.y = player.y + vy\n\n}\nfunction updateStairs() {\n for (var i = 0; i \u003c stairs.length-1; i++) {\n\n stairs[i].y -= 2\n if (stairs[i].y \u003c -10) {\n stair.costumeId = Math.floor(Math.random()*5)\n stairs[i].y += 640\n floor += 1\n stairs[i]. hidden = false\n\n }\n }\n}\nplayer.when('touch', stairs, function(s) {\n vy = 0\n player.y = s.y - 20\n if (s.costumeId == 1) {\n vy = -6\n } \n if (s.costumeId == 5) {\n player.x -= 2\n }\n if (s.costumeId == 4) {\n player.x += 2\n }\n if (s.costumeId == 3 \u0026\u0026 s !== touchOn) {\n setTimeout(function() {\n s.hidden = true\n }, 300)\n\n }\n if (s.costumeId == 2 \u0026\u0026 s !== touchOn) {\n health += 1\n }\n if (s.costumeId == 0 \u0026\u0026 s !== touchOn) {\n health -= 3\n hit = true\n }\n\n touchOn = s\n\n\n})\nfunction checkTouchedCeiling() {\n time = Date.now()\n if (player.touched(ceiling) \u0026\u0026 time - lastTime \u003e 3000) {\n health -= 3\n vy = 0\n lastTime = time\n hit = true\n }\n}\nfunction flashBackground() {\n if (hit == true) {\n setBackdrop('red')\n hit = false\n }\n}\nfunction updateCostume() {\n clock++\n if (clock%6 == 0) {\n if (key.right) {\n if (player.costumeId == 1) {\n player.costumeId = 2\n } else {\n player.costumeId = 1 \n }\n }\n if (key.left) {\n if (player.costumeId == 3) {\n player.costumeId = 4\n } else {\n player.costumeId = 3\n\n }\n\n }\n }\n if (key.right == false \u0026\u0026 key.left == false) {\n player.costumeId = 0\n }\n}","created_at":"2019-05-18T19:29:30.060+08:00","updated_at":"2019-11-11T15:50:58.650+08:00","name":"小朋友下樓梯 副本","language":"javascript","screenshot":{"url":"https://cdn7.koding.school/uploads/project/screenshot/68725/d6cf0d72f86f803cca714b0760c81c1e.jpg"},"parent_id":13412,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":91,"hashid":"2pds5mnz","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":1204238,"file_name":"jump.mp3","project_id":68725,"asset_id":36478,"created_at":"2019-05-18T19:29:30.065+08:00","updated_at":"2019-05-18T19:29:30.065+08:00"},{"id":1204239,"file_name":"gg.mp3","project_id":68725,"asset_id":36479,"created_at":"2019-05-18T19:29:30.066+08:00","updated_at":"2019-05-18T19:29:30.066+08:00"},{"id":1204240,"file_name":"flash.mp3","project_id":68725,"asset_id":36476,"created_at":"2019-05-18T19:29:30.067+08:00","updated_at":"2019-05-18T19:29:30.067+08:00"},{"id":1204241,"file_name":"bg.mp3","project_id":68725,"asset_id":36477,"created_at":"2019-05-18T19:29:30.068+08:00","updated_at":"2019-05-18T19:29:30.068+08:00"},{"id":1204242,"file_name":"conveyor_left.png","project_id":68725,"asset_id":33485,"created_at":"2019-05-18T19:29:30.069+08:00","updated_at":"2019-05-18T19:29:30.069+08:00"},{"id":1204243,"file_name":"conveyor_right.png","project_id":68725,"asset_id":33486,"created_at":"2019-05-18T19:29:30.070+08:00","updated_at":"2019-05-18T19:29:30.070+08:00"},{"id":1204244,"file_name":"fake.png","project_id":68725,"asset_id":33487,"created_at":"2019-05-18T19:29:30.071+08:00","updated_at":"2019-05-18T19:29:30.071+08:00"},{"id":1204245,"file_name":"normal.png","project_id":68725,"asset_id":33488,"created_at":"2019-05-18T19:29:30.072+08:00","updated_at":"2019-05-18T19:29:30.072+08:00"},{"id":1204246,"file_name":"trampoline.png","project_id":68725,"asset_id":33489,"created_at":"2019-05-18T19:29:30.073+08:00","updated_at":"2019-05-18T19:29:30.073+08:00"},{"id":1204247,"file_name":"nails.png","project_id":68725,"asset_id":33490,"created_at":"2019-05-18T19:29:30.073+08:00","updated_at":"2019-05-18T19:29:30.073+08:00"},{"id":1204248,"file_name":"ceiling.png","project_id":68725,"asset_id":33491,"created_at":"2019-05-18T19:29:30.074+08:00","updated_at":"2019-05-18T19:29:30.074+08:00"},{"id":1204249,"file_name":"wall.png","project_id":68725,"asset_id":33492,"created_at":"2019-05-18T19:29:30.075+08:00","updated_at":"2019-05-18T19:29:30.075+08:00"},{"id":1204250,"file_name":"player_3.png","project_id":68725,"asset_id":33493,"created_at":"2019-05-18T19:29:30.076+08:00","updated_at":"2019-05-18T19:29:30.076+08:00"},{"id":1204251,"file_name":"player_4.png","project_id":68725,"asset_id":33494,"created_at":"2019-05-18T19:29:30.077+08:00","updated_at":"2019-05-18T19:29:30.077+08:00"},{"id":1204252,"file_name":"player_2.png","project_id":68725,"asset_id":33495,"created_at":"2019-05-18T19:29:30.078+08:00","updated_at":"2019-05-18T19:29:30.078+08:00"},{"id":1204253,"file_name":"player_5.png","project_id":68725,"asset_id":33496,"created_at":"2019-05-18T19:29:30.079+08:00","updated_at":"2019-05-18T19:29:30.079+08:00"},{"id":1204254,"file_name":"player_1.png","project_id":68725,"asset_id":33497,"created_at":"2019-05-18T19:29:30.080+08:00","updated_at":"2019-05-18T19:29:30.080+08:00"}]
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
繁中
简中
English
日本語
1:1:1
1:1
全寬
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦