{"id":10358,"student_id":13,"content":"// Lesson 1\nsetBackdrop(\"bg.jpg\");\n\nvar topSpike = createSprite(\"topSpike.png\");\ntopSpike.y = 35;\nvar downSpike = createSprite(\"downSpike.png\");\ndownSpike.y = 445;\nvar bird = createSprite(\"bird.png\");\nbird.rotationStyle = \"flipped\";\n// End of Lesson 1\n\n// Lesson 3\nvar vy = -6;\n// Lesson 4\nvar score = 0;\n\n// Lesson 2\nvar firstSpikeY = 80;\nvar leftSpikes = [];\nvar rightSpikes = [];\n\nfor(var i = 0; i\u003c5; i++) {\n var rightSpike = createSprite({\n x: 455,\n y: firstSpikeY+i*65,\n hidden: true,\n costumes: \"rightSpike.png\"\n });\n rightSpikes.push(rightSpike);\n\n var leftSpike = createSprite({\n x: 185,\n y: firstSpikeY+i*65,\n hidden: true,\n costumes: \"leftSpike.png\"\n });\n leftSpikes.push(leftSpike);\n}\n// End of Lesson 2\n\n// Lesson 3\nwhen(\"click\", function() {\n vy = -6;\n});\n// End of Lesson 3\n\nforever(function() {\n // Lesson 3\n bird.stepForward(3);\n bird.y += vy;\n vy += 0.3;\n // End of Lesson 3\n // Lesson 4\n if(bird.x \u003e 440) {\n bird.direction += 180;\n score ++;\n showLeftSpikes(); // Lesson 5 再加入\n }\n if(bird.x \u003c 200) {\n bird.direction += 180;\n score ++;\n showRightSpikes(); // Lesson 5 再加入\n }\n if(score \u003c 10) {\n print(score,300,205,\"#deebef\",60);\n }else{\n print(score,285,205,\"#deebef\",60);\n }\n // End of Lesson 4\n // Lesson 6\n if(bird.touched(topSpike) || bird.touched(downSpike) || \n bird.touched(rightSpikes) || bird.touched(leftSpikes)) {\n stop();\n }\n // End of Lesson 6\n});\n\n// Lesson 5\nfunction showLeftSpikes() {\n for(var i=0;i\u003c4; i++) {\n var showSpikeIndex = Math.floor(Math.random()*5);\n leftSpikes[showSpikeIndex].hidden=false ;\n }\n for(var i=0; i\u003c5; i++){\n rightSpikes[i].hidden = true;\n }\n}\n\nfunction showRightSpikes() {\n for(var i = 0;i\u003c4; i++) {\n var showSpikeIndex = Math.floor(Math.random()*5);\n rightSpikes[showSpikeIndex].hidden=false ;\n }\n for(var i=0; i\u003c5; i++){\n leftSpikes[i].hidden = true;\n }\n}\n// End of Lesson 5\n","created_at":"2017-03-01T20:52:04.729+08:00","updated_at":"2019-11-11T17:54:21.294+08:00","name":"快樂鳥與邪惡刺(完整版)","language":"javascript","screenshot":{"url":null},"parent_id":2,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":173,"hashid":"5j3s93ev","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":229268,"file_name":"bg.jpg","project_id":10358,"asset_id":27804,"created_at":"2017-08-31T22:22:59.914+08:00","updated_at":"2017-08-31T22:22:59.914+08:00"},{"id":229269,"file_name":"rightSpike.png","project_id":10358,"asset_id":27805,"created_at":"2017-08-31T22:22:59.916+08:00","updated_at":"2017-08-31T22:22:59.916+08:00"},{"id":229270,"file_name":"leftSpike.png","project_id":10358,"asset_id":27806,"created_at":"2017-08-31T22:22:59.918+08:00","updated_at":"2017-08-31T22:22:59.918+08:00"},{"id":229271,"file_name":"downSpike.png","project_id":10358,"asset_id":27807,"created_at":"2017-08-31T22:22:59.919+08:00","updated_at":"2017-08-31T22:22:59.919+08:00"},{"id":229272,"file_name":"topSpike.png","project_id":10358,"asset_id":27808,"created_at":"2017-08-31T22:22:59.921+08:00","updated_at":"2017-08-31T22:22:59.921+08:00"},{"id":229273,"file_name":"bird.png","project_id":10358,"asset_id":27809,"created_at":"2017-08-31T22:22:59.923+08:00","updated_at":"2017-08-31T22:22:59.923+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦