{"id":30253,"student_id":71,"content":"setBackdrop('black');\n\n// 創造天花板\nvar ceiling = createSprite(\"ceiling.png\");\nceiling.x = 320;\nceiling.y = 8;\nceiling.layer = 1;\nvar vy = 0;\nvar stairs = [];\nvar flash = false;\nvar life = 10;\nvar score = 0;\nvar touchon;\nvar best = DB.variables.bestScore || 0;\nconsole.log(\"目前最好成績 :\" +best)\nvar left_wall = createSprite(\"wall.png\");\nvar right_wall = createSprite(\"wall.png\");\nleft_wall.x = 130;\nright_wall.x = 510;\nfor (var i = 0; i \u003c 6; i++) {\n var stair = createSprite([\"nails.png\", \"trampoline.png\", \"normal.png\", \"fake.png\", \"conveyor_right.png\", \"\tconveyor_left.png\"]);\n stair.y = i*80;\n stair.x = Math.random()*282+179;\n stair.costumeId = Math.floor(Math.random()*6);\n stairs.push(stair);\n\n}\nsound.play\nvar player = createSprite([\"player_1.png\", \"player_2.png\", \"player_3.png\", \"player_4.png\", \"player_5.png\"]);\nplayer.y = 50;\nplayer.x = 320;\nforever(function() {\n print(\"生命\" +life, 10, 10, 'white', 20);\n print(\"成績\"+ score, 20, 30, 'white', 20);\n vy += 0.15;\n player.y += vy;\n if (key.right \u0026\u0026 !player.touched(right_wall)) {\n player.x += 4;\n player.costumeId = 1\n\n }\n if (key.left \u0026\u0026 !player.touched(left_wall)) {\n player.x -= 4;\n player.costumeId = 3\n }\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].x = Math.random()*282+179;\n stairs[i].y = 480;\n stairs[i].costumeId = Math.floor(Math.random()*6);\n score++;\n stairs[i].hidden = false;\n }\n }\n if(player.y\u003e480 || life\u003c=0){\n setBackdrop(\"red\");\n stop();\n if(score\u003ebest){\n DB.variables.set(\"bestScore\",score) \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 // console.log(touchon.costumeId);\n if (s.costumeId == 1) {\n vy = -5;\n } else if (s.costumeId == 4) {\n player.x += 2;\n } else if (s.costumeId == 5) {\n player.x -= 2;\n } else if (s.costumeId == 0) {\n if (s != touchon) {\n console.log(\"ID:0\");\n life -= 3;\n }\n } else if (s.costumId == 2) {\n if (s != touchon \u0026\u0026 life \u003c 10) {\n life ++;\n }\n } else if (s.costumId == 3)\n setTimeout(function() {}, 400);\n touchon = s;\n\n})","created_at":"2018-05-26T18:57:40.454+08:00","updated_at":"2019-10-10T21:10:30.413+08:00","name":"小朋友下樓梯","language":"javascript","screenshot":{"url":"https://cdn2.koding.school/uploads/project/screenshot/30253/aeb7d7f5f4ecea8fece704e76ac66157.jpg"},"parent_id":13412,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":95,"hashid":"d5msnqz4","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":563534,"file_name":"jump.mp3","project_id":30253,"asset_id":36478,"created_at":"2018-05-26T18:57:40.460+08:00","updated_at":"2018-05-26T18:57:40.460+08:00"},{"id":563535,"file_name":"gg.mp3","project_id":30253,"asset_id":36479,"created_at":"2018-05-26T18:57:40.462+08:00","updated_at":"2018-05-26T18:57:40.462+08:00"},{"id":563536,"file_name":"flash.mp3","project_id":30253,"asset_id":36476,"created_at":"2018-05-26T18:57:40.463+08:00","updated_at":"2018-05-26T18:57:40.463+08:00"},{"id":563537,"file_name":"bg.mp3","project_id":30253,"asset_id":36477,"created_at":"2018-05-26T18:57:40.465+08:00","updated_at":"2018-05-26T18:57:40.465+08:00"},{"id":563538,"file_name":"conveyor_left.png","project_id":30253,"asset_id":33485,"created_at":"2018-05-26T18:57:40.466+08:00","updated_at":"2018-05-26T18:57:40.466+08:00"},{"id":563539,"file_name":"conveyor_right.png","project_id":30253,"asset_id":33486,"created_at":"2018-05-26T18:57:40.468+08:00","updated_at":"2018-05-26T18:57:40.468+08:00"},{"id":563540,"file_name":"fake.png","project_id":30253,"asset_id":33487,"created_at":"2018-05-26T18:57:40.469+08:00","updated_at":"2018-05-26T18:57:40.469+08:00"},{"id":563541,"file_name":"normal.png","project_id":30253,"asset_id":33488,"created_at":"2018-05-26T18:57:40.470+08:00","updated_at":"2018-05-26T18:57:40.470+08:00"},{"id":563542,"file_name":"trampoline.png","project_id":30253,"asset_id":33489,"created_at":"2018-05-26T18:57:40.472+08:00","updated_at":"2018-05-26T18:57:40.472+08:00"},{"id":563543,"file_name":"nails.png","project_id":30253,"asset_id":33490,"created_at":"2018-05-26T18:57:40.473+08:00","updated_at":"2018-05-26T18:57:40.473+08:00"},{"id":563544,"file_name":"ceiling.png","project_id":30253,"asset_id":33491,"created_at":"2018-05-26T18:57:40.474+08:00","updated_at":"2018-05-26T18:57:40.474+08:00"},{"id":563545,"file_name":"wall.png","project_id":30253,"asset_id":33492,"created_at":"2018-05-26T18:57:40.476+08:00","updated_at":"2018-05-26T18:57:40.476+08:00"},{"id":563546,"file_name":"player_3.png","project_id":30253,"asset_id":33493,"created_at":"2018-05-26T18:57:40.477+08:00","updated_at":"2018-05-26T18:57:40.477+08:00"},{"id":563547,"file_name":"player_4.png","project_id":30253,"asset_id":33494,"created_at":"2018-05-26T18:57:40.478+08:00","updated_at":"2018-05-26T18:57:40.478+08:00"},{"id":563548,"file_name":"player_2.png","project_id":30253,"asset_id":33495,"created_at":"2018-05-26T18:57:40.480+08:00","updated_at":"2018-05-26T18:57:40.480+08:00"},{"id":563549,"file_name":"player_5.png","project_id":30253,"asset_id":33496,"created_at":"2018-05-26T18:57:40.481+08:00","updated_at":"2018-05-26T18:57:40.481+08:00"},{"id":563550,"file_name":"player_1.png","project_id":30253,"asset_id":33497,"created_at":"2018-05-26T18:57:40.483+08:00","updated_at":"2018-05-26T18:57:40.483+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦