{"id":476249,"student_id":10,"content":"setBackdrop('bg.png'); //設定背景圖\nlet p1_balloon = createSprite('p2_balloon.png'); //紅色水球\nlet p2_balloon = createSprite('p1_balloon.png'); //紫色水球\nlet p1_hint = createSprite('p1_s0.png', 'p1_s1.png', 'p1_s2.png', 'p1_s3.png'); //紅色玩家按鍵提示\nlet p2_hint = createSprite('p2_s0.png', 'p2_s1.png', 'p2_s2.png', 'p2_s3.png'); //紫色玩家按鍵提示\nlet p1 = createSprite('p1_0.png', 'p1_1.png', 'p1_2.png', 'p1_3.png', 'p1_4.png', 'p1_5.png'); //紅色玩家\nlet p2 = createSprite('p2_0.png', 'p2_1.png', 'p2_2.png', 'p2_3.png', 'p2_4.png', 'p2_5.png'); //紫色玩家\nlet number = createSprite('5.png', '4.png', '3.png', '2.png', '1.png'); //倒數計時\nlet info = createSprite('info.png');\nlet btn_1p = createSprite('btn_1p.png');\nlet btn_2p = createSprite('btn_2p.png');\n\nlet clock = 0; //紀錄遊戲迴圈執行的次數\nlet auto = false; //是否為對戰電腦\n\np1.moveTo(400, 650);\np2.moveTo(800, 650);\np1_hint.moveTo(200, 50);\np2_hint.moveTo(1000, 50);\np1_balloon.moveTo(800, 50);\np2_balloon.moveTo(400, 50);\n\np1_balloon.scale = 0.3; //水球縮小為原本 0.3 倍\np2_balloon.scale = 0.3; //水球縮小為原本 0.3 倍\np1.costumeId = 1; //預設亮起 Z 按鍵\n\n\n//遊戲主迴圈\nfunction gameloop () {\n //如果 p1 水球放大超過原圖尺寸\n if (p1_balloon.scale \u003e 1) {\n p1.costumeId = 4; //p1 切換獲勝圖\n p2.costumeId = 5; //p2 切換失敗圖\n p1_balloon.hidden = true; //隱藏水球\n stop(); //停止遊戲\n }\n\n if (clock == 60) number.costumeId = 1;\n if (clock == 120) number.costumeId = 2;\n if (clock == 180) number.costumeId = 3;\n if (clock == 240) number.costumeId = 4;\n if (clock == 300) number.hidden = true;\n \n //遊戲說明隱藏才開始紀錄迴圈次數\n if (info.hidden) {\n clock++;\n }\n}\n\n//按下 z 按鍵\nfunction pressZ () {\n if (p1_hint.costumeId == 3) {\n p1.costumeId = 1;\n p1_hint.costumeId = 1;\n p1_balloon.scale += 0.005;\n }\n}\n\n//按下 x 按鍵\nfunction pressX () {\n if (p1_hint.costumeId == 1) {\n p1.costumeId = 2;\n p1_hint.costumeId = 2;\n p1_balloon.scale += 0.005;\n }\n}\n\n//按下 c 按鍵\nfunction pressC () {\n if (p1_hint.costumeId == 2) {\n p1.costumeId = 3;\n p1_hint.costumeId = 3;\n p1_balloon.scale += 0.005;\n }\n}\n\n//按下 i 按鍵\nfunction pressI () {\n p2.costumeId = 1;\n p2_hint.costumeId = 1;\n p2_balloon.scale += 0.005;\n}\n\n//按下 o 按鍵\nfunction pressO () {\n p2.costumeId = 2;\n p2_hint.costumeId = 2;\n p2_balloon.scale += 0.005;\n}\n\n//按下 p 按鍵\nfunction pressP () {\n p2.costumeId = 3;\n p2_hint.costumeId = 3;\n p2_balloon.scale += 0.005;\n}\n\n//按下對戰電腦按鈕\nfunction mode_1p () {\n info.hidden = true; //隱藏遊戲說明\n btn_1p.hidden = true; //隱藏對戰電腦按鈕\n btn_2p.hidden = true; //隱藏雙人模式按鈕\n}\n\n//按下雙人對戰按鈕\nfunction mode_2p () {\n info.hidden = true; //隱藏遊戲說明\n btn_1p.hidden = true; //隱藏對戰電腦按鈕\n btn_2p.hidden = true; //隱藏雙人模式按鈕\n}\n\nforever(gameloop); //不斷執行遊戲迴圈\non('keydown', 'z', pressZ); //當按下 z 按鍵時\non('keydown', 'x', pressX); //當按下 x 按鍵時\non('keydown', 'c', pressC); //當按下 c 按鍵時\non('keydown', 'i', pressI); //當按下 i 按鍵時\non('keydown', 'o', pressO); //當按下 o 按鍵時\non('keydown', 'p', pressP); //當按下 p 按鍵時\nbtn_1p.on('click', mode_1p); //當按下對戰電腦\nbtn_2p.on('click', mode_2p); //當按下雙人對戰\n\n","created_at":"2022-12-19T11:53:59.378+08:00","updated_at":"2024-06-11T17:53:36.813+08:00","name":"叩叮灌水球(預設版) 副本","language":"javascript","screenshot":{"url":"https://cdn7.koding.school/uploads/project/screenshot/476249/7e439352f2848017f35809090b546f22.jpg"},"parent_id":470336,"plugin":"Game.set({width: 1200, height: 900})","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":102,"hashid":"npmszqk29","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":10841063,"file_name":"p2_s3.png","project_id":476249,"asset_id":588723,"created_at":"2022-12-19T11:53:59.384+08:00","updated_at":"2022-12-19T11:53:59.384+08:00"},{"id":10841064,"file_name":"p2_s2.png","project_id":476249,"asset_id":588724,"created_at":"2022-12-19T11:53:59.387+08:00","updated_at":"2022-12-19T11:53:59.387+08:00"},{"id":10841065,"file_name":"p2_s1.png","project_id":476249,"asset_id":588725,"created_at":"2022-12-19T11:53:59.388+08:00","updated_at":"2022-12-19T11:53:59.388+08:00"},{"id":10841066,"file_name":"p2_s0.png","project_id":476249,"asset_id":588726,"created_at":"2022-12-19T11:53:59.389+08:00","updated_at":"2022-12-19T11:53:59.389+08:00"},{"id":10841067,"file_name":"p2_balloon.png","project_id":476249,"asset_id":588727,"created_at":"2022-12-19T11:53:59.391+08:00","updated_at":"2022-12-19T11:53:59.391+08:00"},{"id":10841068,"file_name":"p2_5.png","project_id":476249,"asset_id":588728,"created_at":"2022-12-19T11:53:59.392+08:00","updated_at":"2022-12-19T11:53:59.392+08:00"},{"id":10841069,"file_name":"p2_4.png","project_id":476249,"asset_id":588729,"created_at":"2022-12-19T11:53:59.394+08:00","updated_at":"2022-12-19T11:53:59.394+08:00"},{"id":10841070,"file_name":"p2_3.png","project_id":476249,"asset_id":588730,"created_at":"2022-12-19T11:53:59.395+08:00","updated_at":"2022-12-19T11:53:59.395+08:00"},{"id":10841071,"file_name":"p2_2.png","project_id":476249,"asset_id":588731,"created_at":"2022-12-19T11:53:59.396+08:00","updated_at":"2022-12-19T11:53:59.396+08:00"},{"id":10841072,"file_name":"p2_1.png","project_id":476249,"asset_id":588732,"created_at":"2022-12-19T11:53:59.398+08:00","updated_at":"2022-12-19T11:53:59.398+08:00"},{"id":10841073,"file_name":"p2_0.png","project_id":476249,"asset_id":588733,"created_at":"2022-12-19T11:53:59.398+08:00","updated_at":"2022-12-19T11:53:59.398+08:00"},{"id":10841074,"file_name":"p1_s3.png","project_id":476249,"asset_id":588734,"created_at":"2022-12-19T11:53:59.399+08:00","updated_at":"2022-12-19T11:53:59.399+08:00"},{"id":10841075,"file_name":"p1_s2.png","project_id":476249,"asset_id":588735,"created_at":"2022-12-19T11:53:59.401+08:00","updated_at":"2022-12-19T11:53:59.401+08:00"},{"id":10841076,"file_name":"p1_s1.png","project_id":476249,"asset_id":588736,"created_at":"2022-12-19T11:53:59.402+08:00","updated_at":"2022-12-19T11:53:59.402+08:00"},{"id":10841077,"file_name":"p1_s0.png","project_id":476249,"asset_id":588737,"created_at":"2022-12-19T11:53:59.403+08:00","updated_at":"2022-12-19T11:53:59.403+08:00"},{"id":10841078,"file_name":"p1_balloon.png","project_id":476249,"asset_id":588738,"created_at":"2022-12-19T11:53:59.405+08:00","updated_at":"2022-12-19T11:53:59.405+08:00"},{"id":10841079,"file_name":"p1_5.png","project_id":476249,"asset_id":588739,"created_at":"2022-12-19T11:53:59.406+08:00","updated_at":"2022-12-19T11:53:59.406+08:00"},{"id":10841080,"file_name":"p1_4.png","project_id":476249,"asset_id":588740,"created_at":"2022-12-19T11:53:59.407+08:00","updated_at":"2022-12-19T11:53:59.407+08:00"},{"id":10841081,"file_name":"p1_1.png","project_id":476249,"asset_id":588741,"created_at":"2022-12-19T11:53:59.408+08:00","updated_at":"2022-12-19T11:53:59.408+08:00"},{"id":10841082,"file_name":"p1_2.png","project_id":476249,"asset_id":588742,"created_at":"2022-12-19T11:53:59.409+08:00","updated_at":"2022-12-19T11:53:59.409+08:00"},{"id":10841083,"file_name":"p1_3.png","project_id":476249,"asset_id":588743,"created_at":"2022-12-19T11:53:59.411+08:00","updated_at":"2022-12-19T11:53:59.411+08:00"},{"id":10841084,"file_name":"p1_0.png","project_id":476249,"asset_id":588744,"created_at":"2022-12-19T11:53:59.412+08:00","updated_at":"2022-12-19T11:53:59.412+08:00"},{"id":10841085,"file_name":"btn_1p.png","project_id":476249,"asset_id":588745,"created_at":"2022-12-19T11:53:59.413+08:00","updated_at":"2022-12-19T11:53:59.413+08:00"},{"id":10841086,"file_name":"info.png","project_id":476249,"asset_id":588746,"created_at":"2022-12-19T11:53:59.414+08:00","updated_at":"2022-12-19T11:53:59.414+08:00"},{"id":10841087,"file_name":"1.png","project_id":476249,"asset_id":588747,"created_at":"2022-12-19T11:53:59.416+08:00","updated_at":"2022-12-19T11:53:59.416+08:00"},{"id":10841088,"file_name":"2.png","project_id":476249,"asset_id":588748,"created_at":"2022-12-19T11:53:59.417+08:00","updated_at":"2022-12-19T11:53:59.417+08:00"},{"id":10841089,"file_name":"3.png","project_id":476249,"asset_id":588749,"created_at":"2022-12-19T11:53:59.418+08:00","updated_at":"2022-12-19T11:53:59.418+08:00"},{"id":10841090,"file_name":"4.png","project_id":476249,"asset_id":588750,"created_at":"2022-12-19T11:53:59.419+08:00","updated_at":"2022-12-19T11:53:59.419+08:00"},{"id":10841091,"file_name":"5.png","project_id":476249,"asset_id":588751,"created_at":"2022-12-19T11:53:59.420+08:00","updated_at":"2022-12-19T11:53:59.420+08:00"},{"id":10841092,"file_name":"btn_2p.png","project_id":476249,"asset_id":588752,"created_at":"2022-12-19T11:53:59.421+08:00","updated_at":"2022-12-19T11:53:59.421+08:00"},{"id":10841093,"file_name":"bg.png","project_id":476249,"asset_id":588753,"created_at":"2022-12-19T11:53:59.422+08:00","updated_at":"2022-12-19T11:53:59.422+08:00"},{"id":10841094,"file_name":"pump.mp3","project_id":476249,"asset_id":588754,"created_at":"2022-12-19T11:53:59.423+08:00","updated_at":"2022-12-19T11:53:59.423+08:00"},{"id":10841095,"file_name":"bomb.mp3","project_id":476249,"asset_id":588755,"created_at":"2022-12-19T11:53:59.424+08:00","updated_at":"2022-12-19T11:53:59.424+08:00"},{"id":10841096,"file_name":"bgm.mp3","project_id":476249,"asset_id":588756,"created_at":"2022-12-19T11:53:59.425+08:00","updated_at":"2022-12-19T11:53:59.425+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦