{"id":19966,"student_id":283,"content":"setBackdrop('black');\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;\n\nvar vy = 0;\nvar stairs = [];\nvar life = 10;\nvar score = 0;\nvar touchon = 0;\nvar time = 0;\nvar lasttime = 0;\nvar flash = 0;\nsound.play(\"bg.mp3\");\n\n\nfor(var i = 0; i\u003c8 ;i++){\n var stair = createSprite([\"nails.png\", \"trampoline.png\", \"normal.png\", \"fake.png\", \"conveyor_right.png\", \"conveyor_left.png\"]);\n stair.x = Math.random()*(461-170) + 170;\n stair.y = i*80 + 640;\n stair.costumeId = Math.floor(Math.random()*6);\n stairs.push(stair);\n}\n\nplayer.when(\"touch\", stairs, function(stair){\n vy = 0;\n player.y = stair.y - 23;\n if(stair.costumeId == 1){\n vy -= 5;\n sound.play(\"jump.mp3\");\n \n }\n if (stair.costumeId == 4){\n player.x += 2;\n }\n if (stair.costumeId == 5){\n player.x -= 2;\n }\n if(stair.costumeId == 0 \u0026\u0026 stair != touchon ){\n life -= 3;\n flash = 1;\n sound.play(\"flash.mp3\");\n }\n touchon = stair;\n if(stair.costumeId == 2 \u0026\u0026 stair != touchon \u0026\u0026 life \u003c 10){\n life++;\n }\n touchon = stair;\n if(stair.costumeId == 3){\n setTimeout(function () {\n stair.hidden = true;\n } ,300); \n }\n \n});\n\n\n\n \n \n \n \n \n\n\n\nforever(function(){\n print(\"生命值:\"+ life,10,10,\"white\",15);\n print(\"分數:\" + score,10,30,\"white\",15);\n if(flash==1){\n setBackdrop(\"red\");\n flash=0;\n }\n else{\n setBackdrop(\"black\")\n }\n\n if (key.left \u0026\u0026 !player.touched(left_wall)){ \n player.x += -3;\n\n }\n if (key.right \u0026\u0026 !player.touched(right_wall)){ \n player.x += 3;\n }\n vy += 0.05;\n player.y += vy;\n\n for(var i = 0;i \u003c stairs.length; i++){\n stairs[i].y -= 2;\n if(stairs[i].y \u003c10){\n score += 1;\n stairs[i].y = 640;\n stairs[i].x = Math.random()*(461-170) + 170;\n stairs[i].costumeId = Math.floor(Math.random()*6);\n\n\n\n\n }\n \n }\n time=Date.now();\n\n if(player.touched(ceiling)\u0026\u0026(time-lasttime\u003e3000)){\n life -= 3;\n lasttime = time;\n flash = 1;\n sound.play(\"flash.mp3\");\n }\n if(life\u003c0 || player.y \u003e500 ){\n setBackdrop(\"red\");\n stop();\n sound.play(\"gg.mp3\");\n }\n\n\n\n\n\n \n \n }\n \n\n\n);\n","created_at":"2018-01-13T10:30:57.375+08:00","updated_at":"2019-02-23T18:20:35.972+08:00","name":"小朋友下樓梯","language":"javascript","screenshot":{"url":"https://cdn6.koding.school/uploads/project/screenshot/19966/89edcce60b8890776f43b51e69f48ea4.jpg"},"parent_id":13412,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":119,"hashid":"p93s4re2","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":393757,"file_name":"conveyor_left.png","project_id":19966,"asset_id":33485,"created_at":"2018-01-13T10:30:57.382+08:00","updated_at":"2018-01-13T10:30:57.382+08:00"},{"id":393758,"file_name":"conveyor_right.png","project_id":19966,"asset_id":33486,"created_at":"2018-01-13T10:30:57.383+08:00","updated_at":"2018-01-13T10:30:57.383+08:00"},{"id":393759,"file_name":"fake.png","project_id":19966,"asset_id":33487,"created_at":"2018-01-13T10:30:57.385+08:00","updated_at":"2018-01-13T10:30:57.385+08:00"},{"id":393760,"file_name":"normal.png","project_id":19966,"asset_id":33488,"created_at":"2018-01-13T10:30:57.387+08:00","updated_at":"2018-01-13T10:30:57.387+08:00"},{"id":393761,"file_name":"trampoline.png","project_id":19966,"asset_id":33489,"created_at":"2018-01-13T10:30:57.390+08:00","updated_at":"2018-01-13T10:30:57.390+08:00"},{"id":393762,"file_name":"nails.png","project_id":19966,"asset_id":33490,"created_at":"2018-01-13T10:30:57.392+08:00","updated_at":"2018-01-13T10:30:57.392+08:00"},{"id":393763,"file_name":"ceiling.png","project_id":19966,"asset_id":33491,"created_at":"2018-01-13T10:30:57.394+08:00","updated_at":"2018-01-13T10:30:57.394+08:00"},{"id":393764,"file_name":"wall.png","project_id":19966,"asset_id":33492,"created_at":"2018-01-13T10:30:57.397+08:00","updated_at":"2018-01-13T10:30:57.397+08:00"},{"id":393765,"file_name":"player_3.png","project_id":19966,"asset_id":33493,"created_at":"2018-01-13T10:30:57.399+08:00","updated_at":"2018-01-13T10:30:57.399+08:00"},{"id":393766,"file_name":"player_4.png","project_id":19966,"asset_id":33494,"created_at":"2018-01-13T10:30:57.402+08:00","updated_at":"2018-01-13T10:30:57.402+08:00"},{"id":393767,"file_name":"player_2.png","project_id":19966,"asset_id":33495,"created_at":"2018-01-13T10:30:57.404+08:00","updated_at":"2018-01-13T10:30:57.404+08:00"},{"id":393768,"file_name":"player_5.png","project_id":19966,"asset_id":33496,"created_at":"2018-01-13T10:30:57.406+08:00","updated_at":"2018-01-13T10:30:57.406+08:00"},{"id":393769,"file_name":"player_1.png","project_id":19966,"asset_id":33497,"created_at":"2018-01-13T10:30:57.408+08:00","updated_at":"2018-01-13T10:30:57.408+08:00"},{"id":410250,"file_name":"bg.mp3","project_id":19966,"asset_id":36477,"created_at":"2018-01-27T12:07:33.421+08:00","updated_at":"2018-01-27T12:07:33.421+08:00"},{"id":410251,"file_name":"flash.mp3","project_id":19966,"asset_id":36476,"created_at":"2018-01-27T12:07:33.424+08:00","updated_at":"2018-01-27T12:07:33.424+08:00"},{"id":410252,"file_name":"gg.mp3","project_id":19966,"asset_id":36479,"created_at":"2018-01-27T12:07:33.995+08:00","updated_at":"2018-01-27T12:07:33.995+08:00"},{"id":410253,"file_name":"jump.mp3","project_id":19966,"asset_id":36478,"created_at":"2018-01-27T12:07:33.998+08:00","updated_at":"2018-01-27T12:07:33.998+08:00"}]
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
繁中
简中
English
日本語
1:1:1
1:1
全寬
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦