{"id":423764,"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 倍\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 (p2_balloon.scale \u003e 1) {\n p2.costumeId = 4; //p2 切換獲勝圖\n p1.costumeId = 5; //p1 切換失敗圖\n p2_balloon.hidden = true; //隱藏水球\n stop(); //停止遊戲\n }\n\n //遊戲說明隱藏才開始紀錄迴圈次數\n if (info.hidden) {\n clock++;\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) {\n number.hidden = true;\n p1_hint.costumeId = 1; //預設亮起 Z 按鍵\n p2_hint.costumeId = 1; //預設亮起 I 按鍵\n }\n\n if (auto) {\n if (clock % 15 == 0) pressI();\n if (clock % 15 == 5) pressO();\n if (clock % 15 == 10) pressP();\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 if (p2_hint.costumeId == 3) {\n p2.costumeId = 1;\n p2_hint.costumeId = 1;\n p2_balloon.scale += 0.005;\n }\n}\n\n//按下 o 按鍵\nfunction pressO () {\n if (p2_hint.costumeId == 1) {\n p2.costumeId = 2;\n p2_hint.costumeId = 2;\n p2_balloon.scale += 0.005;\n }\n}\n\n//按下 p 按鍵\nfunction pressP () {\n if (p2_hint.costumeId == 2) {\n p2.costumeId = 3;\n p2_hint.costumeId = 3;\n p2_balloon.scale += 0.005;\n }\n}\n\n//按下對戰電腦按鈕\nfunction mode_1p () {\n info.hidden = true; //隱藏遊戲說明\n btn_1p.hidden = true; //隱藏對戰電腦按鈕\n btn_2p.hidden = true; //隱藏雙人模式按鈕\n auto = 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); //當按下雙人對戰","created_at":"2022-08-16T12:23:08.421+08:00","updated_at":"2022-08-16T17:25:02.123+08:00","name":"叩叮灌水球(預設版)","language":"javascript","screenshot":{"url":"https://cdn8.koding.school/uploads/project/screenshot/423764/7c804aa004679629956e9f207beeb0d5.jpg"},"parent_id":2,"plugin":"Game.set({width: 1200, height: 900})","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":127,"hashid":"p93s4r8pe","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":9516675,"file_name":"p2_s3.png","project_id":423764,"asset_id":553515,"created_at":"2022-08-16T12:26:20.255+08:00","updated_at":"2022-08-16T12:26:20.255+08:00"},{"id":9516676,"file_name":"p2_s2.png","project_id":423764,"asset_id":553516,"created_at":"2022-08-16T12:26:20.265+08:00","updated_at":"2022-08-16T12:26:20.265+08:00"},{"id":9516677,"file_name":"p2_s1.png","project_id":423764,"asset_id":553517,"created_at":"2022-08-16T12:26:20.274+08:00","updated_at":"2022-08-16T12:26:20.274+08:00"},{"id":9516678,"file_name":"p2_s0.png","project_id":423764,"asset_id":553518,"created_at":"2022-08-16T12:26:20.283+08:00","updated_at":"2022-08-16T12:26:20.283+08:00"},{"id":9516679,"file_name":"p2_balloon.png","project_id":423764,"asset_id":553519,"created_at":"2022-08-16T12:26:20.293+08:00","updated_at":"2022-08-16T12:26:20.293+08:00"},{"id":9516680,"file_name":"p2_5.png","project_id":423764,"asset_id":553520,"created_at":"2022-08-16T12:26:20.302+08:00","updated_at":"2022-08-16T12:26:20.302+08:00"},{"id":9516681,"file_name":"p2_4.png","project_id":423764,"asset_id":553521,"created_at":"2022-08-16T12:26:20.312+08:00","updated_at":"2022-08-16T12:26:20.312+08:00"},{"id":9516682,"file_name":"p2_3.png","project_id":423764,"asset_id":553522,"created_at":"2022-08-16T12:26:20.321+08:00","updated_at":"2022-08-16T12:26:20.321+08:00"},{"id":9516683,"file_name":"p2_2.png","project_id":423764,"asset_id":553523,"created_at":"2022-08-16T12:26:20.333+08:00","updated_at":"2022-08-16T12:26:20.333+08:00"},{"id":9516684,"file_name":"p2_1.png","project_id":423764,"asset_id":553524,"created_at":"2022-08-16T12:26:20.343+08:00","updated_at":"2022-08-16T12:26:20.343+08:00"},{"id":9516685,"file_name":"p2_0.png","project_id":423764,"asset_id":553525,"created_at":"2022-08-16T12:26:20.357+08:00","updated_at":"2022-08-16T12:26:20.357+08:00"},{"id":9516686,"file_name":"p1_s3.png","project_id":423764,"asset_id":553526,"created_at":"2022-08-16T12:26:20.364+08:00","updated_at":"2022-08-16T12:26:20.364+08:00"},{"id":9516687,"file_name":"p1_s2.png","project_id":423764,"asset_id":553527,"created_at":"2022-08-16T12:26:20.375+08:00","updated_at":"2022-08-16T12:26:20.375+08:00"},{"id":9516688,"file_name":"p1_s1.png","project_id":423764,"asset_id":553528,"created_at":"2022-08-16T12:26:20.382+08:00","updated_at":"2022-08-16T12:26:20.382+08:00"},{"id":9516689,"file_name":"p1_s0.png","project_id":423764,"asset_id":553529,"created_at":"2022-08-16T12:26:20.392+08:00","updated_at":"2022-08-16T12:26:20.392+08:00"},{"id":9516690,"file_name":"p1_balloon.png","project_id":423764,"asset_id":553530,"created_at":"2022-08-16T12:26:20.400+08:00","updated_at":"2022-08-16T12:26:20.400+08:00"},{"id":9516691,"file_name":"p1_5.png","project_id":423764,"asset_id":553531,"created_at":"2022-08-16T12:26:20.410+08:00","updated_at":"2022-08-16T12:26:20.410+08:00"},{"id":9516692,"file_name":"p1_4.png","project_id":423764,"asset_id":553532,"created_at":"2022-08-16T12:26:20.421+08:00","updated_at":"2022-08-16T12:26:20.421+08:00"},{"id":9516693,"file_name":"p1_1.png","project_id":423764,"asset_id":553533,"created_at":"2022-08-16T12:26:20.429+08:00","updated_at":"2022-08-16T12:26:20.429+08:00"},{"id":9516694,"file_name":"p1_2.png","project_id":423764,"asset_id":553534,"created_at":"2022-08-16T12:26:20.439+08:00","updated_at":"2022-08-16T12:26:20.439+08:00"},{"id":9516695,"file_name":"p1_3.png","project_id":423764,"asset_id":553535,"created_at":"2022-08-16T12:26:20.450+08:00","updated_at":"2022-08-16T12:26:20.450+08:00"},{"id":9516696,"file_name":"p1_0.png","project_id":423764,"asset_id":553536,"created_at":"2022-08-16T12:26:20.460+08:00","updated_at":"2022-08-16T12:26:20.460+08:00"},{"id":9516697,"file_name":"btn_1p.png","project_id":423764,"asset_id":553537,"created_at":"2022-08-16T12:26:20.469+08:00","updated_at":"2022-08-16T12:26:20.469+08:00"},{"id":9516698,"file_name":"info.png","project_id":423764,"asset_id":553538,"created_at":"2022-08-16T12:26:20.500+08:00","updated_at":"2022-08-16T12:26:20.500+08:00"},{"id":9516699,"file_name":"1.png","project_id":423764,"asset_id":553539,"created_at":"2022-08-16T12:26:20.542+08:00","updated_at":"2022-08-16T12:26:20.542+08:00"},{"id":9516700,"file_name":"2.png","project_id":423764,"asset_id":553540,"created_at":"2022-08-16T12:26:20.553+08:00","updated_at":"2022-08-16T12:26:20.553+08:00"},{"id":9516701,"file_name":"3.png","project_id":423764,"asset_id":553541,"created_at":"2022-08-16T12:26:20.563+08:00","updated_at":"2022-08-16T12:26:20.563+08:00"},{"id":9516702,"file_name":"4.png","project_id":423764,"asset_id":553542,"created_at":"2022-08-16T12:26:20.573+08:00","updated_at":"2022-08-16T12:26:20.573+08:00"},{"id":9516703,"file_name":"5.png","project_id":423764,"asset_id":553543,"created_at":"2022-08-16T12:26:20.585+08:00","updated_at":"2022-08-16T12:26:20.585+08:00"},{"id":9516704,"file_name":"btn_2p.png","project_id":423764,"asset_id":553544,"created_at":"2022-08-16T12:26:20.595+08:00","updated_at":"2022-08-16T12:26:20.595+08:00"},{"id":9516705,"file_name":"bg.png","project_id":423764,"asset_id":553545,"created_at":"2022-08-16T12:26:20.606+08:00","updated_at":"2022-08-16T12:26:20.606+08:00"},{"id":9516706,"file_name":"pump.mp3","project_id":423764,"asset_id":553546,"created_at":"2022-08-16T12:26:20.615+08:00","updated_at":"2022-08-16T12:26:20.615+08:00"},{"id":9516707,"file_name":"bomb.mp3","project_id":423764,"asset_id":553547,"created_at":"2022-08-16T12:26:20.624+08:00","updated_at":"2022-08-16T12:26:20.624+08:00"},{"id":9516708,"file_name":"bgm.mp3","project_id":423764,"asset_id":553548,"created_at":"2022-08-16T12:26:20.665+08:00","updated_at":"2022-08-16T12:26:20.665+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦