{"id":8772,"student_id":1486,"content":"var stairs = [];\nvar down = 0;\nvar life = 10;\nvar floor = 0;\nvar lastTime = 0;\nvar hit;\n\nfor(var i=0; i\u003c5; i++) {\n var stair = createSprite([\"conveyor_left.png\",\"conveyor_right.png\",\"normal.png\",\"nails.png\",\"trampoline.png\"]);\n\tstair.x = Math.random()*(388-stair.width/2) + stair.width/2;\n stair.y = i*80 + 400;\n stair.costumeId = Math.floor(Math.random()*5);\n stairs.push(stair);\n}\n\nforever(function() {\n setBackdrop('#333333');\n if(hit) {\n setBackdrop('#ee4444');\n hit = false;\n }\n\tif (key.left) {\n \tplayer.x -= 3;\n }\n if (key.right){\n \tplayer.x += 3;\n }\n if(player.x\u003e(388-player.width/2)){\n player.x = (388-player.width/2);\n }\n if(player.x\u003c(9+player.width/2)){\n player.x = (9+player.width/2);\n }\n if (!player.touched(stairs)) {\n \tdown += 0.15;\n \tplayer.y += down;\n } else {\n player.y -= 2;\n down = 0;\n }\n for (var i=0; i\u003cstairs.length; i++) {\n \tstairs[i].y -= 2;\n if(stairs[i].y \u003c -10) {\n stairs[i].costumeId = Math.floor(Math.random()*5);\n \tstairs[i].y += 400;\n floor += 1;\n }\n }\n var time = Date.now();\n if(player.touched(ceiling) \u0026\u0026 time - lastTime \u003e 3000) {\n life -= 3;\n lastTime = time;\n hit = true;\n }\n print(\"Floor: \"+floor, 400, 10, '#eeeeee', 20);\n print(\"Life: \"+life, 400, 40, '#eeeeee', 20);\n if (life \u003c= 0 || player.y \u003e 400) {\n \tsetBackdrop('#ee4444');\n stop();\n }\n});\n\nplayer.when('touch',stairs, function(s) {\n\tif(s.costumeId == 0) {\n \tplayer.x -= 2;\n }\n if(s.costumeId == 1) {\n \tplayer.x += 2;\n }\n if(s.costumeId == 4) {\n player.y -= 10;\n down = -7;\n }\n if(s.costumeId == 2 \u0026\u0026 s !== player.touchOn) {\n \tlife += 1;\n }\n if(s.costumeId == 3 \u0026\u0026 s !== player.touchOn) {\n \tlife -= 3;\n hit = true;\n }\n player.touchOn = s;\n});\n\nsetTimeout(function(){\n player.moveTo(stairs[0]);\n player.y-=140;\n}, 20);","created_at":"2017-03-01T20:52:04.729+08:00","updated_at":"2019-11-08T15:25:48.106+08:00","name":"新專案-20170526110635053","language":"javascript","screenshot":{"url":"https://cdn7.koding.school/uploads/project/screenshot/8772/ec3c7893f334b0da211c48ad492d494d.jpg"},"parent_id":2,"plugin":"setBackdrop('black');\nGame.set({\n\twidth: 640,\n height: 400\n});\nvar left_wall = createSprite({\n\tcostumes: \"wall.png\",\n x: 9\n});\nvar right_wall = createSprite({\n\tcostumes: \"wall.png\",\n x: 391\n});\nvar ceiling = createSprite({\n\tcostumes: \"ceiling.png\",\n x: 200,\n y: 8\n});\nvar player = createSprite({\n\tcostumes: \"player.png\",\n y: 50\n});\nplayer.life = 10;","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":420,"hashid":"wdksdy2","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":190916,"file_name":"conveyor_left.png","project_id":8772,"asset_id":23069,"created_at":"2017-08-04T16:15:38.515+08:00","updated_at":"2017-08-04T16:15:38.515+08:00"},{"id":190917,"file_name":"conveyor_right.png","project_id":8772,"asset_id":23070,"created_at":"2017-08-04T16:15:38.517+08:00","updated_at":"2017-08-04T16:15:38.517+08:00"},{"id":190918,"file_name":"fake.png","project_id":8772,"asset_id":23071,"created_at":"2017-08-04T16:15:38.518+08:00","updated_at":"2017-08-04T16:15:38.518+08:00"},{"id":190919,"file_name":"normal.png","project_id":8772,"asset_id":23072,"created_at":"2017-08-04T16:15:38.519+08:00","updated_at":"2017-08-04T16:15:38.519+08:00"},{"id":190920,"file_name":"trampoline.png","project_id":8772,"asset_id":23073,"created_at":"2017-08-04T16:15:38.521+08:00","updated_at":"2017-08-04T16:15:38.521+08:00"},{"id":190921,"file_name":"nails.png","project_id":8772,"asset_id":23074,"created_at":"2017-08-04T16:15:38.522+08:00","updated_at":"2017-08-04T16:15:38.522+08:00"},{"id":190922,"file_name":"player.png","project_id":8772,"asset_id":23075,"created_at":"2017-08-04T16:15:38.523+08:00","updated_at":"2017-08-04T16:15:38.523+08:00"},{"id":190923,"file_name":"ceiling.png","project_id":8772,"asset_id":23076,"created_at":"2017-08-04T16:15:38.525+08:00","updated_at":"2017-08-04T16:15:38.525+08:00"},{"id":190924,"file_name":"wall.png","project_id":8772,"asset_id":23077,"created_at":"2017-08-04T16:15:38.526+08:00","updated_at":"2017-08-04T16:15:38.526+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦