{"id":173348,"student_id":12205,"content":"setBackdrop(\"bg.jpg\");\n\nvar score = 0;\nvar gotscore = false;\n\nvar bird = createSprite(\"bird.png\");\nbird.x = 320;\nbird.y = 200;\nbird.v = 0;\n\nvar tube = createSprite(\"tube.png\");\ntube.x = 660;\ntube.y = 240;\n\nvar ground = createSprite(\"ground.jpg\");\nground.x = 320;\nground.y = 440;\n\nforever(function() {\n tube.x = tube.x-4;\n bird.v = bird.v+0.25;\n bird.y = bird.y+bird.v;\n\n if (tube.x\u003c-40) {\n tube.x = 660;\n tube.y = 40+Math.random()*280;\n gotscore = false;\n }\n if (tube.x \u003c 300 \u0026\u0026 gotscore == false) {\n score=score+1;\n gotscore = true;\n }\n print(\"Score=\"+score);\n});\n\nbird.when(\"touch\", tube, function() {\n stop();\n});\nbird.when(\"touch\", ground, function() {\n stop();\n});\nsetBackdrop(\"black\");\n\nvar lights = [];\nfor(var i = 0;i\u003c15;i++) {\n var light = {\n x:cursor.x,\n y:cursor.y,\n color:\"rgb(\"+Math.floor(Math.random()*255)+\",\"+Math.floor(Math.random()*255)+\",\"+Math.floor(Math.random()*255)+\")\",\n vx:Math.random() *8 - 4,\n vy:Math.random() *8 - 4,\n r:Math.random() * 6\n };\n lights.push(light);\n};\n\nforever(function(){\n for(var i=0;i\u003clights.length;i++) {\n var light = lights[i];\n light.x +=light.vx;\n light.y +=light.vy;\n light.vy +=0.1\n light.r *=0.99\n pen.size = 0;\n pen.fillColor = light.color;\n if(light.r\u003e1) {\n pen.drawCircle(light.x,light.y,light.r);\n };\n }\n for(var i = 0;i\u003c15;i++) {\n var light = {\n x:cursor.x,\n y:cursor.y,\n color:\"rgb(\"+Math.floor(Math.random()*255)+\",\"+Math.floor(Math.random()*255)+\",\"+Math.floor(Math.random()*255)+\")\",\n vx:Math.random() *8 - 4,\n vy:Math.random() *8 - 4,\n r:Math.random() * 6\n };\n lights.push(light);\n };\n \n});\n\n\n\n\n","created_at":"2020-07-29T12:52:58.238+08:00","updated_at":"2020-07-31T13:02:08.347+08:00","name":"Flappy Bird.js","language":"javascript","screenshot":{"url":"https://cdn9.koding.school/uploads/project/screenshot/173348/89edcce60b8890776f43b51e69f48ea4.jpg"},"parent_id":2,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":38,"hashid":"qmds658j","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":2977744,"file_name":"bird.png","project_id":173348,"asset_id":244234,"created_at":"2020-07-29T12:53:11.064+08:00","updated_at":"2020-07-29T12:53:11.064+08:00"},{"id":2977745,"file_name":"bg.jpg","project_id":173348,"asset_id":244235,"created_at":"2020-07-29T12:53:11.069+08:00","updated_at":"2020-07-29T12:53:11.069+08:00"},{"id":2977746,"file_name":"ground.jpg","project_id":173348,"asset_id":244236,"created_at":"2020-07-29T12:53:11.074+08:00","updated_at":"2020-07-29T12:53:11.074+08:00"},{"id":2977747,"file_name":"tube.png","project_id":173348,"asset_id":244237,"created_at":"2020-07-29T12:53:11.080+08:00","updated_at":"2020-07-29T12:53:11.080+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦