{"id":32273,"student_id":1486,"content":"setBackdrop(\"bg.png\");\n\n// tile {w: 32, h: 32}\nvar tiles = [];\n\nvar koding = createSprite({\n costumes: \"koding.png\",\n x: 32*1 + 32/2,\n y: 32*10 - 100\n});\nkoding.isFalling = true;\nkoding.fallTime = 0;\nkoding.gravity = 0;\nkoding.horizontalConflicted = false;\n\nkoding.forever(function(){\n if(tiles.find((n)=\u003e{return n.y == this.y+32+16 \u0026\u0026 this.x-16 \u003c= n.x \u0026\u0026 n.x \u003c= this.x+16;}) !== undefined){\n this.isFalling = false;\n }else{\n this.isFalling = true;\n }\n if(this.isFalling){\n this.gravity += Math.pow((this.fallTime++) / (32/4) / 4.9, 2);\n }\n koding.speedX = 0;\n koding.speedY = 0;\n if(key.w){\n if(!this.isFalling){\n this.gravity = -40/9.8;\n this.isFalling = true;\n this.leftConflicted = false;\n this.rightConflicted = false;\n }\n }\n if(key.a \u0026\u0026 !this.leftConflicted){\n this.x -= 4;\n }\n if(key.d \u0026\u0026 !this.rightConflicted){\n this.x += 4;\n }\n if(this.y \u003e 999){\n koding.destroy();\n }\n this.y += this.gravity;\n});\n\nkoding.when(\"touch\", tiles, function(n){\n this.leftConflicted = false;\n this.rightConflicted = false;\n if(n.isSolid){\n if(this.y+16 \u003c n.y){ //tile's top\n this.gravity = 0;\n this.isFalling = false;\n this.fallTime = 0;\n this.y = n.y-32-16;\n }else{\n if(this.x \u003c n.x){ //tile's left\n this.x = n.x - 16 - 16;\n this.rightConflicted = true;\n }\n if(this.x \u003e n.x){ //tile's right\n this.x = n.x + 16 + 16;\n this.leftConflicted = true;\n }\n }\n }\n});\n\nfor(var i = 0; i \u003c 16; i++){\n for(var j = 11; j \u003c 15; j++){\n var ele;\n if(j == 11){\n ele = createSprite(\"Ground.png\");\n }else{\n ele = createSprite(\"Dirt2.png\");\n }\n ele.scale = 0.25;\n ele.x = (i + 1/2) * (128 * 0.25);\n ele.y = (j + 1/2) * (128 * 0.25);\n ele.isSolid = true;\n ele.friction = 1;\n tiles.push(ele);\n }\n}\nfor(var j = 0; j \u003c 11; j++){\n var ele = createSprite(\"Ground.png\");\n ele.opacity = 0;\n ele.scale = 0.25;\n ele.x = 16;\n ele.y = (j + 1/2) * (128 * 0.25);\n ele.isSolid = true;\n ele.friction = 1;\n tiles.push(ele);\n}\n\nvar ele = createSprite(\"Ground.png\");\n ele.opacity = 1000;\n ele.scale = 0.25;\n ele.x = 272;\n ele.y = (10 + 1/2) * (128 * 0.25);\n ele.isSolid = true;\n ele.friction = 1;\n tiles.push(ele);\nvar ele2 = createSprite(\"Ground.png\");\n ele2.opacity = 1000;\n ele2.scale = 0.25;\n ele2.x = 112;\n ele2.y = (10 + 1/2) * (128 * 0.25);\n ele2.isSolid = true;\n ele2.friction = 1;\n tiles.push(ele2);\n","created_at":"2018-06-23T22:52:02.905+08:00","updated_at":"2019-11-02T09:11:26.011+08:00","name":"Kodio 1-1","language":"javascript","screenshot":{"url":"https://cdn9.koding.school/uploads/project/screenshot/32273/daa58dd19b073feebcafdc7bfdbe4f21.jpg"},"parent_id":2,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":239,"hashid":"d5msn8nr","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":603006,"file_name":"Dirt.png","project_id":32273,"asset_id":73073,"created_at":"2018-06-23T22:52:52.712+08:00","updated_at":"2018-06-23T22:52:52.712+08:00"},{"id":603007,"file_name":"Dirt2.png","project_id":32273,"asset_id":73074,"created_at":"2018-06-23T22:52:53.161+08:00","updated_at":"2018-06-23T22:52:53.161+08:00"},{"id":603008,"file_name":"DirtRock.png","project_id":32273,"asset_id":73075,"created_at":"2018-06-23T22:52:53.163+08:00","updated_at":"2018-06-23T22:52:53.163+08:00"},{"id":603009,"file_name":"DirtRock2.png","project_id":32273,"asset_id":73076,"created_at":"2018-06-23T22:52:53.466+08:00","updated_at":"2018-06-23T22:52:53.466+08:00"},{"id":603010,"file_name":"Grass.png","project_id":32273,"asset_id":73077,"created_at":"2018-06-23T22:52:53.469+08:00","updated_at":"2018-06-23T22:52:53.469+08:00"},{"id":603011,"file_name":"Grass2.png","project_id":32273,"asset_id":73078,"created_at":"2018-06-23T22:52:54.065+08:00","updated_at":"2018-06-23T22:52:54.065+08:00"},{"id":603012,"file_name":"GrassNGrass.png","project_id":32273,"asset_id":73079,"created_at":"2018-06-23T22:52:54.067+08:00","updated_at":"2018-06-23T22:52:54.067+08:00"},{"id":603013,"file_name":"GrassNGrass2.png","project_id":32273,"asset_id":73080,"created_at":"2018-06-23T22:52:54.340+08:00","updated_at":"2018-06-23T22:52:54.340+08:00"},{"id":603014,"file_name":"Ground.png","project_id":32273,"asset_id":73081,"created_at":"2018-06-23T22:52:54.342+08:00","updated_at":"2018-06-23T22:52:54.342+08:00"},{"id":603015,"file_name":"Ground2.png","project_id":32273,"asset_id":73082,"created_at":"2018-06-23T22:52:54.809+08:00","updated_at":"2018-06-23T22:52:54.809+08:00"},{"id":603016,"file_name":"Sand.png","project_id":32273,"asset_id":73083,"created_at":"2018-06-23T22:52:54.811+08:00","updated_at":"2018-06-23T22:52:54.811+08:00"},{"id":603017,"file_name":"Sand2.png","project_id":32273,"asset_id":73084,"created_at":"2018-06-23T22:52:55.072+08:00","updated_at":"2018-06-23T22:52:55.072+08:00"},{"id":603003,"file_name":"pop.wav","project_id":32273,"asset_id":9,"created_at":"2018-06-23T22:52:02.927+08:00","updated_at":"2018-06-23T22:53:27.869+08:00"},{"id":603021,"file_name":"bg.png","project_id":32273,"asset_id":73088,"created_at":"2018-06-23T23:09:22.883+08:00","updated_at":"2018-06-23T23:09:22.883+08:00"},{"id":603023,"file_name":"koding.png","project_id":32273,"asset_id":73090,"created_at":"2018-06-23T23:36:03.837+08:00","updated_at":"2018-06-23T23:36:03.837+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦