{"id":138885,"student_id":1404,"content":"setBackdrop('bg.png');\nvar p1 = createSprite('pipes.png'); //1號水管\nvar p2 = createSprite('pipes.png'); //2號水管\nvar p3 = createSprite('pipes.png'); //3號水管\nvar gd = createSprite('ground.png'); //地板\nvar bird = createSprite('bird_1.png', 'bird_2.png'); //鳥\nvar hint = createSprite('hint.png'); //開始提示圖\nvar end = createSprite('gameover.png'); //結束提示圖\n\nvar speed = 0; //鳥的墜落速度\nvar score = 0; //遊戲分數\nvar start = false; //是否開始遊戲\n\nhint.hidden = false; //隱藏開始提示圖\nend.hidden = true; //隱藏結束提示圖\n\nforever(loop); // 不斷執行遊戲迴圈\non('keydown', jump); //按下任意按鍵使鳥跳躍\nbird.on('touch', [p1, p2, p3, gd], gameover); //當鳥碰撞到障礙物時結束遊戲\ncreateSound(\"bgm.mp3\", true);\n\np1.x = 0;\np2.x = 500;\np3.x = 1000;\n\n// 遊戲主迴圈\nfunction loop () {\n moveGround(); //移動地板\n movePipe(p1); //移動1號水管\n movePipe(p2); //移動2號水管\n movePipe(p3); //移動2號水管\n moveBird(); //移動鳥\n}\n\n//移動地板\nfunction moveGround () {\n gd.x = gd.x - 6;\n if (gd.x \u003c 0) {\n gd.x = 1200;\n }\n}\n\n//移動水管\nfunction movePipe (pipe) {\n pipe.x = pipe.x - 6;\n if (pipe.x \u003c -100) {\n pipe.x = pipe.x + 1500;\n if (start == true) {\n pipe.y = Math.random() * 500 + 150;\n score = score + 1;\n }\n }\n //drawText(印出內容, x, y, 'color', 大小);\n drawText(score, 10, 10, 'white', 50);\n\n}\n\n//鳥的墜落 \u0026 翅膀動畫\nfunction moveBird () {\n if (start == true) {\n speed = speed + 0.8;\n bird.y = bird.y + speed;\n }\n // 下墜\n if (speed \u003e 0) {\n bird.costumeId = 0;\n }\n //上升\n if (speed \u003c 0) {\n bird.costumeId = 1;\n }\n}\n\n//鳥的跳躍\nfunction jump () {\n speed = -12;\n start = true;\n createSound(\"jump.mp3\");\n hint.hidden = true;\n}\n\n//遊戲結束\nfunction gameover () {\n stop();\n createSound(\"gg.mp3\");\n end.hidden = false;\n}","created_at":"2020-04-11T02:14:41.363+08:00","updated_at":"2020-04-13T23:53:51.111+08:00","name":"flappy bird(預設版)","language":"javascript","screenshot":{"url":"https://cdn0.koding.school/uploads/project/screenshot/138885/76845adc55874cbd6bf83ebb18e80f09.jpg"},"parent_id":2,"plugin":"Game.set({ width: 1200, height: 900 });","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":56,"hashid":"9ygsj4we","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":2394462,"file_name":"bgm.mp3","project_id":138885,"asset_id":204194,"created_at":"2020-04-11T02:15:07.643+08:00","updated_at":"2020-04-11T02:15:07.643+08:00"},{"id":2394463,"file_name":"jump.mp3","project_id":138885,"asset_id":204195,"created_at":"2020-04-11T02:15:07.647+08:00","updated_at":"2020-04-11T02:15:07.647+08:00"},{"id":2394464,"file_name":"bg.png","project_id":138885,"asset_id":204196,"created_at":"2020-04-11T02:15:07.653+08:00","updated_at":"2020-04-11T02:15:07.653+08:00"},{"id":2394465,"file_name":"bird_1.png","project_id":138885,"asset_id":204197,"created_at":"2020-04-11T02:15:07.657+08:00","updated_at":"2020-04-11T02:15:07.657+08:00"},{"id":2394466,"file_name":"bird_2.png","project_id":138885,"asset_id":204198,"created_at":"2020-04-11T02:15:07.660+08:00","updated_at":"2020-04-11T02:15:07.660+08:00"},{"id":2394467,"file_name":"gameover.png","project_id":138885,"asset_id":204199,"created_at":"2020-04-11T02:15:07.664+08:00","updated_at":"2020-04-11T02:15:07.664+08:00"},{"id":2394468,"file_name":"ground.png","project_id":138885,"asset_id":204200,"created_at":"2020-04-11T02:15:07.667+08:00","updated_at":"2020-04-11T02:15:07.667+08:00"},{"id":2394469,"file_name":"hint.png","project_id":138885,"asset_id":204201,"created_at":"2020-04-11T02:15:07.671+08:00","updated_at":"2020-04-11T02:15:07.671+08:00"},{"id":2394470,"file_name":"pipes.png","project_id":138885,"asset_id":204202,"created_at":"2020-04-11T02:15:07.675+08:00","updated_at":"2020-04-11T02:15:07.675+08:00"},{"id":2394471,"file_name":"gg.mp3","project_id":138885,"asset_id":204203,"created_at":"2020-04-11T02:15:07.679+08:00","updated_at":"2020-04-11T02:15:07.679+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦