{"id":39842,"student_id":1658,"content":"setBackdrop('black');\nvar flash = []\nvar touchOn=-1\nvar score = 0\nvar life = 5\nvar vy = 0\nvar stairs = []\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;\nfor (var i = 0; i \u003c 6; i++) {\n var stair = createSprite(['nails.png', 'trampoline.png', 'normal.png', 'fake.png', 'conveyor_right.png', 'conveyor_left.png'])\n stair.y = 480 - 80 * i\n stair.x = Math.random()*282 + 179\n stair.costumeId = Math.floor(Math.random()*6)\n stairs.push(stair)\n sound.play('bg.mp3')\n\n\n}\nforever(function() {\n print('世界紀錄:'+score, 320, 450, \"orage\", 30)\n print('分數:' + score, 10, 10, \"blue\", 30)\n print('生命:' + life, 40, 40, \"blue\", 30)\n vy += 0.05\n if (key.right \u0026\u0026 !player.touched(right_wall)) {\n player.x += 2\n player.costumeId = 1\n }\n if (key.left \u0026\u0026 !player.touched(left_wall)) {\n player.x -= 2\n player.costumeId = 4\n }\n player.y += vy\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].y += 480\n stairs[i].costumeId = Math.floor(Math.random()*6)\n score += 1;\n if (life \u003c 0 || player.y \u003e 480) {\n setBackdrop('red');\n sound.play('gg.mp3')\n stop();\n }\n }\n }\n if (player.touched(ceiling)) {\n flash = false\n }\n if (flash === false) {\n setBackdrop('red');\n flash === true\n setBackdrop('black');\n flash === false\n\n }\n\n\n\n\n\n\n\n\n\n});\nplayer.when(\"touch\", stairs, function(s) {\n vy = 0;\n player.y = s.y - 23\n console.log(s.costumeId)\n if (s.costumeId == 1) {\n vy -= 8\n sound.play('jump.mp3')\n } else if (s.costumeId != touchOn \u0026\u0026 s.costumeId == 0) {\n life -= 3\n flash = true\n\n } else if (s.costumeId == 5) {\n player.x -= 2\n } else if (s.costumeId == 4) {\n player.x += 2\n } else if (s.costumeId != touchOn \u0026\u0026 s.costumeId == 2) {\n if (life \u003c 10) {\n life += 1\n }\n }\n if (s.costumeId != touchOn \u0026\u0026 s.costumeId == 3) {\n setTimeout(function() {\n s.hidden = true;\n }, 200);\n }\n touchOn = s.costumeId;\n var best = DB.variables.bestScore || 0\nvar flash = []\nvar touchOn=-1\nvar score = 0\nvar life = 5\nvar vy = 0\nvar player_1 = createSprite([\"player_1.png\", \"player_2.png\", \"player_3.png\", \"player_4.png\", \"player_5.png\"]);\nplayer_1.y = 50\nforever(function() {\n print('世界紀錄:'+score, 320, 450, \"orage\", 30)\n print('分數:' + score, 10, 10, \"blue\", 30)\n print('生命:' + life, 40, 40, \"blue\", 30)\n vy += 0.05\n if (key.d \u0026\u0026 !player_1.touched(d_wall)) {\n player_1.x += 2\n player_1.costumeId = 1\n }\n if (key.a \u0026\u0026 !player_1.touched(a_wall)) {\n player_1.x -= 2\n player_1.costumeId = 4\n }\n player_1.y += vy\n});\nplayer_1.when(\"touch\", stairs, function(s) {\n vy = 0;\n player_1.y = s.y - 23\n console.log(s.costumeId)\n if (s.costumeId == 1) {\n vy -= 8\n sound.play('jump.mp3')\n } else if (s.costumeId != touchOn \u0026\u0026 s.costumeId == 0) {\n life -= 3\n flash = true\n\n } else if (s.costumeId == 5) {\n player_1.x -= 2\n } else if (s.costumeId == 4) {\n player_1.x += 2\n } else if (s.costumeId != touchOn \u0026\u0026 s.costumeId == 2) {\n if (life \u003c 10) {\n life += 1\n }\n }\n if (s.costumeId != touchOn \u0026\u0026 s.costumeId == 3) {\n setTimeout(function() {\n s.hidden = true;\n }, 200);\n }\n touchOn = s.costumeId;\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n});\n});","created_at":"2018-08-25T14:21:43.055+08:00","updated_at":"2019-10-04T00:45:42.024+08:00","name":"小朋友下樓梯 副本","language":"javascript","screenshot":{"url":"https://cdn9.koding.school/uploads/project/screenshot/39842/1107359bab177904090b292647d5c87a.jpg"},"parent_id":13412,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":89,"hashid":"p93s3zme","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":703257,"file_name":"jump.mp3","project_id":39842,"asset_id":36478,"created_at":"2018-08-25T14:21:43.064+08:00","updated_at":"2018-08-25T14:21:43.064+08:00"},{"id":703258,"file_name":"gg.mp3","project_id":39842,"asset_id":36479,"created_at":"2018-08-25T14:21:43.066+08:00","updated_at":"2018-08-25T14:21:43.066+08:00"},{"id":703259,"file_name":"flash.mp3","project_id":39842,"asset_id":36476,"created_at":"2018-08-25T14:21:43.068+08:00","updated_at":"2018-08-25T14:21:43.068+08:00"},{"id":703260,"file_name":"bg.mp3","project_id":39842,"asset_id":36477,"created_at":"2018-08-25T14:21:43.069+08:00","updated_at":"2018-08-25T14:21:43.069+08:00"},{"id":703261,"file_name":"conveyor_left.png","project_id":39842,"asset_id":33485,"created_at":"2018-08-25T14:21:43.071+08:00","updated_at":"2018-08-25T14:21:43.071+08:00"},{"id":703262,"file_name":"conveyor_right.png","project_id":39842,"asset_id":33486,"created_at":"2018-08-25T14:21:43.073+08:00","updated_at":"2018-08-25T14:21:43.073+08:00"},{"id":703263,"file_name":"fake.png","project_id":39842,"asset_id":33487,"created_at":"2018-08-25T14:21:43.074+08:00","updated_at":"2018-08-25T14:21:43.074+08:00"},{"id":703264,"file_name":"normal.png","project_id":39842,"asset_id":33488,"created_at":"2018-08-25T14:21:43.076+08:00","updated_at":"2018-08-25T14:21:43.076+08:00"},{"id":703265,"file_name":"trampoline.png","project_id":39842,"asset_id":33489,"created_at":"2018-08-25T14:21:43.077+08:00","updated_at":"2018-08-25T14:21:43.077+08:00"},{"id":703266,"file_name":"nails.png","project_id":39842,"asset_id":33490,"created_at":"2018-08-25T14:21:43.079+08:00","updated_at":"2018-08-25T14:21:43.079+08:00"},{"id":703267,"file_name":"ceiling.png","project_id":39842,"asset_id":33491,"created_at":"2018-08-25T14:21:43.081+08:00","updated_at":"2018-08-25T14:21:43.081+08:00"},{"id":703268,"file_name":"wall.png","project_id":39842,"asset_id":33492,"created_at":"2018-08-25T14:21:43.082+08:00","updated_at":"2018-08-25T14:21:43.082+08:00"},{"id":703269,"file_name":"player_3.png","project_id":39842,"asset_id":33493,"created_at":"2018-08-25T14:21:43.084+08:00","updated_at":"2018-08-25T14:21:43.084+08:00"},{"id":703270,"file_name":"player_4.png","project_id":39842,"asset_id":33494,"created_at":"2018-08-25T14:21:43.085+08:00","updated_at":"2018-08-25T14:21:43.085+08:00"},{"id":703271,"file_name":"player_2.png","project_id":39842,"asset_id":33495,"created_at":"2018-08-25T14:21:43.087+08:00","updated_at":"2018-08-25T14:21:43.087+08:00"},{"id":703272,"file_name":"player_5.png","project_id":39842,"asset_id":33496,"created_at":"2018-08-25T14:21:43.089+08:00","updated_at":"2018-08-25T14:21:43.089+08:00"},{"id":703273,"file_name":"player_1.png","project_id":39842,"asset_id":33497,"created_at":"2018-08-25T14:21:43.091+08:00","updated_at":"2018-08-25T14:21:43.091+08:00"}]
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
繁中
简中
English
日本語
1:1:1
1:1
全寬
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦