{"id":20163,"student_id":1806,"content":"setBackdrop('black');\nsound.play(\"bg.mp3\");\nvar life = 10;\nvar score = 0;\nvar touchOn = 0;\nvar flash=false;\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;\nvar vy = 0;\nvar stairs = [];\nfor (i = 0; i \u003c 6; i++) {\n var c = createSprite([\"nails.png\", \"trampoline.png\", \"normal.png\", \"fake.png\", \"conveyor_left.png\", \"conveyor_right.png\"]);\n c.x = Math.random() * 282 + 179;\n c.y = i * 80;\n c.costumeId = Math.floor(Math.random() * 6);\n stairs.push(c);\n\n}\nforever(function () {\n if(player.touched(ceiling)\u0026\u0026touchOn!=ceiling \u0026\u0026 player.touched(stairs)==false){\n life-=3;\n touchOn=ceiling;\n }\n setBackdrop(\"black\");\n if(flash==true){\n setBackdrop(\"red\");\n flash=false;\n };\n\n\n print(\"生命:\" + life, 10, 10, \"white\")\n print(\"分數:\" + score, 10, 30, \"white\")\n\n for (var i = 0; i \u003c stairs.length; i++) {\n var s = stairs[i];\n s.y -= 2;\n if (s.y \u003c 0) {\n s.y += 480;\n s.x = Math.random() * 283 + 179;\n s.costumeId = Math.floor(Math.random() * 4)\n }\n }\n\n if (key.right \u0026\u0026 player.touched(right_wall) == false) {\n player.x += 3;\n }\n if (key.left \u0026\u0026 player.touched(left_wall) == false) {\n player.x -= 3;\n }\n\n vy = vy + 0.15;\n player.y += vy;\n\n for (i = 0; i \u003c 6; i++) {\n stairs[i].y -= 2;\n if (stairs[i].y \u003c 0) {\n stairs[i].y = 480;\n }\n }\n if(life\u003c0 || player.y\u003e480){\n setBackdrop(\"red\");\n stop();\n \n }\n\n});\n\nplayer.when(\"touch\", stairs, function (c) {\n player.y = c.y - 23\n vy = 0;\n\n if (c.costumeId == 0 \u0026\u0026 c!=touchOn) {\n life-=3;\n flash=true;\n if(life\u003c0){\n stop();\n }\n }\n\n if (c.costumeId == 1) {\n vy -= 7;\n }\n\n if (c.costumeId == 2 \u0026\u0026 c!=touchOn) {\n if(life\u003c10){\n life+=1;\n }\n }\n if (c.costumeId == 3) {\n c.hidden=true;\n\n }\n if (c.costumeId == 4) {\n player.x -= 3;\n\n }\n if (c.costumeId == 5) {\n player.x += 3;\n }\n\n touchOn = c;\n\n\n});\n\n\n\n\n","created_at":"2018-01-13T18:40:47.310+08:00","updated_at":"2019-10-27T03:50:00.594+08:00","name":"小朋友下樓梯","language":"javascript","screenshot":{"url":"https://cdn8.koding.school/uploads/project/screenshot/20163/70ff98b8fa1e3f9fe69792b830f9846a.jpg"},"parent_id":13412,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":226,"hashid":"rdvs4vkv","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":396979,"file_name":"conveyor_left.png","project_id":20163,"asset_id":33485,"created_at":"2018-01-13T18:40:47.319+08:00","updated_at":"2018-01-13T18:40:47.319+08:00"},{"id":396980,"file_name":"conveyor_right.png","project_id":20163,"asset_id":33486,"created_at":"2018-01-13T18:40:47.321+08:00","updated_at":"2018-01-13T18:40:47.321+08:00"},{"id":396981,"file_name":"fake.png","project_id":20163,"asset_id":33487,"created_at":"2018-01-13T18:40:47.323+08:00","updated_at":"2018-01-13T18:40:47.323+08:00"},{"id":396982,"file_name":"normal.png","project_id":20163,"asset_id":33488,"created_at":"2018-01-13T18:40:47.325+08:00","updated_at":"2018-01-13T18:40:47.325+08:00"},{"id":396983,"file_name":"trampoline.png","project_id":20163,"asset_id":33489,"created_at":"2018-01-13T18:40:47.327+08:00","updated_at":"2018-01-13T18:40:47.327+08:00"},{"id":396984,"file_name":"nails.png","project_id":20163,"asset_id":33490,"created_at":"2018-01-13T18:40:47.329+08:00","updated_at":"2018-01-13T18:40:47.329+08:00"},{"id":396985,"file_name":"ceiling.png","project_id":20163,"asset_id":33491,"created_at":"2018-01-13T18:40:47.331+08:00","updated_at":"2018-01-13T18:40:47.331+08:00"},{"id":396986,"file_name":"wall.png","project_id":20163,"asset_id":33492,"created_at":"2018-01-13T18:40:47.333+08:00","updated_at":"2018-01-13T18:40:47.333+08:00"},{"id":396987,"file_name":"player_3.png","project_id":20163,"asset_id":33493,"created_at":"2018-01-13T18:40:47.335+08:00","updated_at":"2018-01-13T18:40:47.335+08:00"},{"id":396988,"file_name":"player_4.png","project_id":20163,"asset_id":33494,"created_at":"2018-01-13T18:40:47.337+08:00","updated_at":"2018-01-13T18:40:47.337+08:00"},{"id":396989,"file_name":"player_2.png","project_id":20163,"asset_id":33495,"created_at":"2018-01-13T18:40:47.340+08:00","updated_at":"2018-01-13T18:40:47.340+08:00"},{"id":396990,"file_name":"player_5.png","project_id":20163,"asset_id":33496,"created_at":"2018-01-13T18:40:47.343+08:00","updated_at":"2018-01-13T18:40:47.343+08:00"},{"id":396991,"file_name":"player_1.png","project_id":20163,"asset_id":33497,"created_at":"2018-01-13T18:40:47.345+08:00","updated_at":"2018-01-13T18:40:47.345+08:00"},{"id":413012,"file_name":"bg.mp3","project_id":20163,"asset_id":36477,"created_at":"2018-01-27T19:34:24.719+08:00","updated_at":"2018-01-27T19:34:24.719+08:00"},{"id":413013,"file_name":"flash.mp3","project_id":20163,"asset_id":36476,"created_at":"2018-01-27T19:34:24.722+08:00","updated_at":"2018-01-27T19:34:24.722+08:00"},{"id":413014,"file_name":"gg.mp3","project_id":20163,"asset_id":36479,"created_at":"2018-01-27T19:34:25.640+08:00","updated_at":"2018-01-27T19:34:25.640+08:00"},{"id":413015,"file_name":"jump.mp3","project_id":20163,"asset_id":36478,"created_at":"2018-01-27T19:34:25.643+08:00","updated_at":"2018-01-27T19:34:25.643+08:00"}]
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
繁中
简中
English
日本語
1:1:1
1:1
全寬
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦