{"id":183203,"student_id":2589,"content":"","created_at":"2020-08-20T12:42:04.049+08:00","updated_at":"2023-03-12T10:56:13.764+08:00","name":"跳躍吧!小鳥 (試玩版) ","language":"javascript","screenshot":{"url":"https://cdn5.koding.school/uploads/project/screenshot/183203/b61d4565f599cbdc8fe4a69dda98fba0.jpg"},"parent_id":183202,"plugin":"Game.set({ width: 1200, height: 900 });\n\nsetBackdrop('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_0.png', 'bird_1.png'); //鳥\nvar hint = createSprite('hint.png'); //開始提示圖\nvar end = createSprite('gameover.png'); //結束提示圖\n\nvar speed = 0; //鳥的墜落速度\nvar score = 0; //遊戲分數\nvar start = false; //是否開始遊戲\n\n// hint.hidden = true; //隱藏開始提示圖\nend.hidden = true; //隱藏結束提示圖\n\n\nforever(loop); // 不斷執行遊戲迴圈\non('keydown', jump); //按下任意按鍵使鳥跳躍\nbird.on('touch', [p1, p2, p3, gd], gameover); //當鳥碰撞到障礙物時結束遊戲\n\np1.x = 0;\np2.x = 500;\np3.x = 1000;\n\ncreateSound('bgm.mp3', true);\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 = 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(score, 10, 10, 'white', 60);\n}\n\n//鳥的墜落 \u0026 翅膀動畫\nfunction moveBird () {\n if (start == true) {\n speed = speed + 0.8;\n bird.y = bird.y + speed;\n }\n if (speed \u003e 0) {\n bird.costumeId = 0;\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}\n\n","description":null,"note":null,"status":"public","like_student_ids":[12215,12791,11948,3687,12489,12156,22364,10730,22496,13181,10439,11693,13020,15015,13328,16439,10113,9877,7403,15249,10289,12472,11629,5624,21138,22217,18423,9253,33576,34119,10891,12466,16470,20923,22222,28012,21190,11203,5135,6110,18379,27791,19637,17119,22663,15229,24276,41431,21073,23459,30988,22248,24144,19007,23460,26482,10801,17139,21012,16209,11425,26650,19419,12023,29570,35303,34617,26721,9872,28540,34696,8046,27966,26424,23484,33489,16514,33563,12519,23594,22028,35074,26704,52321,22510,35321,53911,53969,43026,18345,53048,54324,22910,35870,55339,41370,39398,43507,57059,27140,37770,38994,28207,42219,56073,41973,56681,42279,40009,19451,43742,45370,47168,47286,47766,42967,48037,33044,32561,46924,19704,20811,67154,49462],"is_featured":false,"views":8632,"hashid":"p93sp2wj","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":3115762,"file_name":"gg.mp3","project_id":183203,"asset_id":203971,"created_at":"2020-08-20T12:42:04.055+08:00","updated_at":"2020-08-20T12:42:04.055+08:00"},{"id":3115763,"file_name":"jump.mp3","project_id":183203,"asset_id":203979,"created_at":"2020-08-20T12:42:04.056+08:00","updated_at":"2020-08-20T12:42:04.056+08:00"},{"id":3115764,"file_name":"bgm.mp3","project_id":183203,"asset_id":203980,"created_at":"2020-08-20T12:42:04.057+08:00","updated_at":"2020-08-20T12:42:04.057+08:00"},{"id":3115765,"file_name":"bg.png","project_id":183203,"asset_id":202590,"created_at":"2020-08-20T12:42:04.058+08:00","updated_at":"2020-08-20T12:42:04.058+08:00"},{"id":3115766,"file_name":"bird_0.png","project_id":183203,"asset_id":202591,"created_at":"2020-08-20T12:42:04.059+08:00","updated_at":"2020-08-20T12:42:04.059+08:00"},{"id":3115767,"file_name":"bird_1.png","project_id":183203,"asset_id":202592,"created_at":"2020-08-20T12:42:04.059+08:00","updated_at":"2020-08-20T12:42:04.059+08:00"},{"id":3115768,"file_name":"gameover.png","project_id":183203,"asset_id":202098,"created_at":"2020-08-20T12:42:04.060+08:00","updated_at":"2020-08-20T12:42:04.060+08:00"},{"id":3115769,"file_name":"ground.png","project_id":183203,"asset_id":202595,"created_at":"2020-08-20T12:42:04.061+08:00","updated_at":"2020-08-20T12:42:04.061+08:00"},{"id":3115770,"file_name":"hint.png","project_id":183203,"asset_id":202593,"created_at":"2020-08-20T12:42:04.062+08:00","updated_at":"2020-08-20T12:42:04.062+08:00"},{"id":3115771,"file_name":"pipes.png","project_id":183203,"asset_id":202594,"created_at":"2020-08-20T12:42:04.063+08:00","updated_at":"2020-08-20T12:42:04.063+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦