{"id":70300,"student_id":1998,"content":"sound.play(\"bg.mp3\")\nsetBackdrop('black');\nvar life = 10\nvar score = 0\nvar LastTime = 0\nvar touchOn = \"\"\nvar ceiling = createSprite(\"ceiling.png\");\nceiling.x = 320;\nceiling.y = 8;\nceiling.layer = 1;\nvar left_wall = createSprite(\"wall.png\");\nvar right_wall = createSprite(\"wall.png\");\nleft_wall.x = 130;\nright_wall.x = 510;\n\nvar best = DB.variables.bestScore || 0\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 flash\nfor (var i = 0; i \u003c 6; i++) {\n var stair = createSprite([\"trampoline.png\", \"nails.png\", \"fake.png\", \"conveyor_right.png\", \"conveyor_left.png\", \"normal.png\"]);\n stair.y = i*100 + 160\n stair.x = Math.random()*282 + 179\n stair.costumeId = Math.floor(Math.random()*6)\n stairs.push(stair)\n\n\n}\n\nforever(function() {\n vy += 0.15\n player.y += vy\n\n setBackdrop('black')\n if (flash) {\n setBackdrop('red')\n flash = false\n }\n if (key.right \u0026\u0026 !player.touched(right_wall)) {\n player.x += 3\n }\n if (key.left \u0026\u0026 !player.touched(left_wall)) {\n player.x += -3\n }\n\n for (var i = 0; i \u003c stairs.length; i++) {\n stairs[i].y -= 2\n if (stairs[i].y \u003c 0) {\n stairs[i].y += 640\n stairs[i].x = Math.random()*261 + 179\n stairs[i].costumeId = Math.floor(Math.random()*6)\n score ++\n stairs[i].hidden = false\n }\n }\n var time = Date.now()\n if (player.touched(ceiling) \u0026\u0026 time - LastTime \u003e 3000) {\n life -= 3\n flash = true\n sound.play(\"flash.mp3\")\n LastTime = time\n\n }\n\n print(\"分數:\" + score, 10, 40, 'white', 20)\n print(\"生命:\" + life, 10, 80, 'white', 20)\n print(\"最高紀錄:\" + best, 520, 40, 'white', 20)\n if (life \u003c= 0 || player.y \u003e 480) {\n\n if (score \u003e best) {\n DB.variables.set('bestScore', score)\n }\n\n setBackdrop('red')\n stop()\n sound.play(\"gg.mp3\")\n }\n})\nplayer.when(\"touch\", stairs, function(s) {\n vy = 0\n player.y = s.y - 23\n if (s.costumeId == 3) {\n player.x += 2\n }\n if (s.costumeId == 4) {\n player.x -= 2\n }\n if (s.costumeId == 1 \u0026\u0026 s != touchOn) {\n life -= 3\n flash = true\n sound.play(\"flash.mp3\")\n }\n if (s.costumeId == 5 \u0026\u0026 s != touchOn \u0026\u0026 life \u003c 10) {\n life += 1\n }\n if (s.costumeId == 2) {\n setTimeout(function() {\n s.hidden = true\n }, 200);\n }\n if (s.costumeId == 0) {\n vy = -5\n sound.play(\"jump.mp3\")\n }\n\n touchOn = s\n\n})\n\nvar clock = 0\nforever(function() {\n if (clock % 6 == 0) {\n if (key.right) {\n if (player.costumeId == 1) {\n player.costumeId = 2\n } else {\n player.costumeId = 1\n }\n }\n if (key.left) {\n if (player.costumeId == 3) {\n player.costumeId = 4\n } else {\n player.costumeId = 3\n }\n }\n }\n if (!key.right \u0026\u0026 !key.left) {}\n\n clock ++\n})","created_at":"2019-05-29T22:26:05.706+08:00","updated_at":"2019-10-28T02:40:52.247+08:00","name":"小朋友下樓梯 副本","language":"javascript","screenshot":{"url":"https://cdn8.koding.school/uploads/project/screenshot/70300/f5383abb16de114fe831649cf9fdda64.jpg"},"parent_id":13412,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":46,"hashid":"gk4smrw9","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":1230189,"file_name":"jump.mp3","project_id":70300,"asset_id":36478,"created_at":"2019-05-29T22:26:05.711+08:00","updated_at":"2019-05-29T22:26:05.711+08:00"},{"id":1230190,"file_name":"gg.mp3","project_id":70300,"asset_id":36479,"created_at":"2019-05-29T22:26:05.712+08:00","updated_at":"2019-05-29T22:26:05.712+08:00"},{"id":1230191,"file_name":"flash.mp3","project_id":70300,"asset_id":36476,"created_at":"2019-05-29T22:26:05.714+08:00","updated_at":"2019-05-29T22:26:05.714+08:00"},{"id":1230192,"file_name":"bg.mp3","project_id":70300,"asset_id":36477,"created_at":"2019-05-29T22:26:05.715+08:00","updated_at":"2019-05-29T22:26:05.715+08:00"},{"id":1230193,"file_name":"conveyor_left.png","project_id":70300,"asset_id":33485,"created_at":"2019-05-29T22:26:05.716+08:00","updated_at":"2019-05-29T22:26:05.716+08:00"},{"id":1230194,"file_name":"conveyor_right.png","project_id":70300,"asset_id":33486,"created_at":"2019-05-29T22:26:05.717+08:00","updated_at":"2019-05-29T22:26:05.717+08:00"},{"id":1230195,"file_name":"fake.png","project_id":70300,"asset_id":33487,"created_at":"2019-05-29T22:26:05.718+08:00","updated_at":"2019-05-29T22:26:05.718+08:00"},{"id":1230196,"file_name":"normal.png","project_id":70300,"asset_id":33488,"created_at":"2019-05-29T22:26:05.720+08:00","updated_at":"2019-05-29T22:26:05.720+08:00"},{"id":1230197,"file_name":"trampoline.png","project_id":70300,"asset_id":33489,"created_at":"2019-05-29T22:26:05.721+08:00","updated_at":"2019-05-29T22:26:05.721+08:00"},{"id":1230198,"file_name":"nails.png","project_id":70300,"asset_id":33490,"created_at":"2019-05-29T22:26:05.722+08:00","updated_at":"2019-05-29T22:26:05.722+08:00"},{"id":1230199,"file_name":"ceiling.png","project_id":70300,"asset_id":33491,"created_at":"2019-05-29T22:26:05.724+08:00","updated_at":"2019-05-29T22:26:05.724+08:00"},{"id":1230200,"file_name":"wall.png","project_id":70300,"asset_id":33492,"created_at":"2019-05-29T22:26:05.724+08:00","updated_at":"2019-05-29T22:26:05.724+08:00"},{"id":1230201,"file_name":"player_3.png","project_id":70300,"asset_id":33493,"created_at":"2019-05-29T22:26:05.726+08:00","updated_at":"2019-05-29T22:26:05.726+08:00"},{"id":1230202,"file_name":"player_4.png","project_id":70300,"asset_id":33494,"created_at":"2019-05-29T22:26:05.727+08:00","updated_at":"2019-05-29T22:26:05.727+08:00"},{"id":1230203,"file_name":"player_2.png","project_id":70300,"asset_id":33495,"created_at":"2019-05-29T22:26:05.728+08:00","updated_at":"2019-05-29T22:26:05.728+08:00"},{"id":1230204,"file_name":"player_5.png","project_id":70300,"asset_id":33496,"created_at":"2019-05-29T22:26:05.730+08:00","updated_at":"2019-05-29T22:26:05.730+08:00"},{"id":1230205,"file_name":"player_1.png","project_id":70300,"asset_id":33497,"created_at":"2019-05-29T22:26:05.730+08:00","updated_at":"2019-05-29T22:26:05.730+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦