{"id":169499,"student_id":12205,"content":"setBackdrop(\"bg.jpg\");\r\nvar rightSpikes = [];\r\nvar leftSpikes = [];\r\nvar score=0;\r\n\r\nvar topSpike = createSprite(\"topSpike.png\");\r\ntopSpike.y = 35;\r\n\r\nvar downSpike = createSprite(\"downSpike.png\");\r\ndownSpike.y = 445;\r\n\r\nvar bird = createSprite(\"bird.png\");\r\nbird.rotationStyle = \"flipped\";\r\n\r\nfor (var i=0;i\u003c5;i++){\r\n\r\n var rightSpike = createSprite({\r\n x:455,\r\n y:80+i*65,\r\n hidden:true,\r\n costumes:\"rightSpike.png\"\r\n });\r\n rightSpikes.push(rightSpike)\r\n\r\n var leftSpike = createSprite({\r\n x:185,\r\n y:80+i*65,\r\n hidden:true, \r\n costumes:\" leftSpike.png\"\r\n });\r\n leftSpikes.push(leftSpike);\r\n}\r\n\r\nvar vy = -6;\r\n\r\nwhen (\"click\",function(){\r\n vy = -6;\r\n});\r\n\r\n\r\nforever(function(){\r\n bird.stepForward(3);\r\n bird.y += vy;\r\n vy+= 0.3;\r\n\r\n if(bird.x \u003e 440){\r\n bird.direction +=180;\r\n score++;\r\n showLeftSpikes();\r\n }\r\n\r\n if(bird.x \u003c 200){\r\n bird.direction +=180;\r\n score++;\r\n showRightSpikes();\r\n }\r\n if(score \u003c 10){\r\n print(score,300,205,\"#deebef\",60);\r\n }else{\r\n print(score,300,205,\"#deebef\",60);\r\n }\r\n if(bird.touched(topSpike)||bird.touched(downSpike)||\r\n bird.touched(rightSpikes)||bird.touched(leftSpikes)){\r\n stop();\r\n }\r\n});\r\n\r\n\r\nfunction showLeftSpikes(){\r\n for(var i=0;i\u003c4;i++){\r\n var showSpikeIdex = Math.floor(Math.random()*5) \r\n leftSpikes[showSpikeIdex].hidden=false;\r\n }\r\n for(var i=0;i\u003c5;i++){\r\n rightSpikes[i].hidden=true\r\n }\r\n}\r\n\r\nfunction showRightSpikes(){\r\n for(var i=0;i\u003c4;i++){\r\n var showSpikeIdex = Math.floor(Math.random()*5) \r\n rightSpikes[showSpikeIdex].hidden=false;\r\n }\r\n for(var i=0;i\u003c5;i++){\r\n leftSpikes[i].hidden=true\r\n }\r\n}\r\n\r\n // showLeftSpikes();\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n","created_at":"2020-07-22T18:49:50.009+08:00","updated_at":"2020-07-22T18:50:21.719+08:00","name":"快樂鳥與邪惡刺","language":"javascript","screenshot":{"url":"https://cdn4.koding.school/uploads/project/screenshot/169499/da616d3e247ca42212e0595fe7d626e8.jpg"},"parent_id":3,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":39,"hashid":"jzms26nw","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":2929387,"file_name":"bird.png","project_id":169499,"asset_id":241094,"created_at":"2020-07-22T18:50:05.824+08:00","updated_at":"2020-07-22T18:50:05.824+08:00"},{"id":2929388,"file_name":"topSpike.png","project_id":169499,"asset_id":241095,"created_at":"2020-07-22T18:50:05.828+08:00","updated_at":"2020-07-22T18:50:05.828+08:00"},{"id":2929389,"file_name":"downSpike.png","project_id":169499,"asset_id":241096,"created_at":"2020-07-22T18:50:05.832+08:00","updated_at":"2020-07-22T18:50:05.832+08:00"},{"id":2929390,"file_name":"leftSpike.png","project_id":169499,"asset_id":241097,"created_at":"2020-07-22T18:50:05.835+08:00","updated_at":"2020-07-22T18:50:05.835+08:00"},{"id":2929391,"file_name":"rightSpike.png","project_id":169499,"asset_id":241098,"created_at":"2020-07-22T18:50:05.839+08:00","updated_at":"2020-07-22T18:50:05.839+08:00"},{"id":2929392,"file_name":"bg.jpg","project_id":169499,"asset_id":241099,"created_at":"2020-07-22T18:50:05.843+08:00","updated_at":"2020-07-22T18:50:05.843+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦