{"id":14341,"student_id":227,"content":"setBackdrop('black');\nvar flash = false;\n// 創造天花板\nvar ceiling = createSprite(\"ceiling.png\");\nceiling.x = 320;\nceiling.y = 8;\nceiling.layer = 1;\nvar touchon;\n// 創造左右牆壁\nvar left_wall = createSprite(\"wall.png\");\nvar right_wall = createSprite(\"wall.png\");\nleft_wall.x = 130;\nright_wall.x = 510;\nvar vy = 0\nvar score = 0;\nvar life = 10;\nvar stairs = [];\nfor (var i = 0; i \u003c 6; i++) {\n var s = createSprite([\"nails.png\", \"trampoline.png\", \"normal.png\", \"fake.png\", \"conveyor_right.png\", \"conveyor_left.png\"]);\n s.x = 179 + Math.random() * 282\n s.y = i * 80\n s.costumeId = Math.floor(Math.random() * 6)\n\n stairs.push(s);\n}\n// 創造玩家\nvar player = createSprite([\"player_1.png\", \"player_2.png\", \"player_3.png\", \"player_4.png\", \"player_5.png\"]);\nplayer.y = 50;\n\nforever(function () {\n print(\"分數:\" + score, 10, 10, \"green\", 25);\n print(\"生命:\" + life, 10, 40, \"whit\", 25);\n setBackdrop(\"black\")\n if(flash==true){\n setBackdrop(\"red\");\n sound.play(\"flash.mp3\")\n flash=false\n }\n if (key.right) {\n if (player.touched(right_wall) == false) {\n player.x = player.x + 3\n }\n \n }\n if (key.left) {\n if (player.touched(left_wall) == false) {\n\n player.x = player.x - 3\n }\n }\n if (life \u003c= 0||player.y\u003e480) {\n setBackdrop('red');\n stop();\n\n }\n vy = vy + 0.15\n player.y = player.y + vy\n for (var i = 0; i \u003c 6; i++) {\n if (stairs[i].touched(ceiling)) {\n }\n stairs[i].y = stairs[i].y - 3;\n if (stairs[i].y \u003c 0) {\n s.hidden = false;\n stairs[i].y += 480;\n stairs[i].x = 179 + Math.random() * 282\n score = score + 1\n stairs[i].costumeId = Math.floor(Math.random() * 6)\n }\n }\n});\nvar time = 0;\nplayer.when(\"touch\", ceiling,function (){\n if(time+3000 \u003c Date.now()){\n life=life-2\n time = Date.now();\n flash=true\n vy=0\n }\n});\nplayer.when(\"touch\", stairs, function (s) {\n player.y = s.y - 23;\n vy = 0\n if (s.costumeId == 0) {\n if (s != touchon) {\n life = life - 2\n flash=true\n }\n touchon = s;\n }\n if (s.costumeId == 1) {\n vy = vy - 10\n sound.play(\"jump.mp3\")\n }\n if (s.costumeId == 2) {\n if (s != touchon) {\n if (life \u003c 10) {\n life = life + 1\n }\n }\n touchon = s;\n }\n if (s.costumeId == 3) {\n s.hidden = true\n }\n if (s.costumeId == 4) {\n player.x += 2\n }\n if (s.costumeId == 5) {\n player.x += -2\n }\n touchon = s;\n});\n","created_at":"2017-03-01T20:52:04.729+08:00","updated_at":"2019-10-21T21:10:22.487+08:00","name":"小朋友下樓梯","language":"javascript","screenshot":{"url":"https://cdn7.koding.school/uploads/project/screenshot/14341/36b6c57ed1a7c77677b13c1d044ffdcd.jpg"},"parent_id":13412,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":121,"hashid":"6rps9kzv","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":296004,"file_name":"conveyor_left.png","project_id":14341,"asset_id":33485,"created_at":"2017-10-28T18:33:34.274+08:00","updated_at":"2017-10-28T18:33:34.274+08:00"},{"id":296005,"file_name":"conveyor_right.png","project_id":14341,"asset_id":33486,"created_at":"2017-10-28T18:33:34.277+08:00","updated_at":"2017-10-28T18:33:34.277+08:00"},{"id":296006,"file_name":"fake.png","project_id":14341,"asset_id":33487,"created_at":"2017-10-28T18:33:34.280+08:00","updated_at":"2017-10-28T18:33:34.280+08:00"},{"id":296007,"file_name":"normal.png","project_id":14341,"asset_id":33488,"created_at":"2017-10-28T18:33:34.283+08:00","updated_at":"2017-10-28T18:33:34.283+08:00"},{"id":296008,"file_name":"trampoline.png","project_id":14341,"asset_id":33489,"created_at":"2017-10-28T18:33:34.286+08:00","updated_at":"2017-10-28T18:33:34.286+08:00"},{"id":296009,"file_name":"nails.png","project_id":14341,"asset_id":33490,"created_at":"2017-10-28T18:33:34.289+08:00","updated_at":"2017-10-28T18:33:34.289+08:00"},{"id":296010,"file_name":"ceiling.png","project_id":14341,"asset_id":33491,"created_at":"2017-10-28T18:33:34.292+08:00","updated_at":"2017-10-28T18:33:34.292+08:00"},{"id":296011,"file_name":"wall.png","project_id":14341,"asset_id":33492,"created_at":"2017-10-28T18:33:34.295+08:00","updated_at":"2017-10-28T18:33:34.295+08:00"},{"id":296012,"file_name":"player_3.png","project_id":14341,"asset_id":33493,"created_at":"2017-10-28T18:33:34.298+08:00","updated_at":"2017-10-28T18:33:34.298+08:00"},{"id":296013,"file_name":"player_4.png","project_id":14341,"asset_id":33494,"created_at":"2017-10-28T18:33:34.302+08:00","updated_at":"2017-10-28T18:33:34.302+08:00"},{"id":296014,"file_name":"player_2.png","project_id":14341,"asset_id":33495,"created_at":"2017-10-28T18:33:34.307+08:00","updated_at":"2017-10-28T18:33:34.307+08:00"},{"id":296015,"file_name":"player_5.png","project_id":14341,"asset_id":33496,"created_at":"2017-10-28T18:33:34.310+08:00","updated_at":"2017-10-28T18:33:34.310+08:00"},{"id":296016,"file_name":"player_1.png","project_id":14341,"asset_id":33497,"created_at":"2017-10-28T18:33:34.313+08:00","updated_at":"2017-10-28T18:33:34.313+08:00"},{"id":420278,"file_name":"flash.mp3","project_id":14341,"asset_id":36476,"created_at":"2018-02-03T17:37:30.432+08:00","updated_at":"2018-02-03T17:37:30.432+08:00"},{"id":420279,"file_name":"jump.mp3","project_id":14341,"asset_id":36478,"created_at":"2018-02-03T17:37:31.736+08:00","updated_at":"2018-02-03T17:37:31.736+08:00"}]
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
繁中
简中
English
日本語
1:1:1
1:1
全寬
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦