{"id":460992,"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\ncreateSound('bgm.mp3', true);\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 createSound('bomb.mp3');\n }\n\n //如果 p2 水球放大超過原圖尺寸\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 createSound('bomb.mp3');\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;\n p2_hint.costumeId = 1;\n }\n\n if (auto) {\n if (clock % 12 == 0) pressI();\n if (clock % 12 == 4) pressO();\n if (clock % 12 == 8) pressP();\n }\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 createSound('pump.mp3');\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 createSound('pump.mp3');\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-11-16T18:12:13.752+08:00","updated_at":"2022-11-16T18:19:52.326+08:00","name":"叩叮灌水球(預設版)","language":"javascript","screenshot":{"url":"https://cdn0.koding.school/uploads/project/screenshot/460992/af5d9beb2ecc868a6e7f2fe680e92c91.jpg"},"parent_id":2,"plugin":"Game.set({width: 1200, height: 900})","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":125,"hashid":"4y3szwmwd","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":10462394,"file_name":"pump.mp3","project_id":460992,"asset_id":582966,"created_at":"2022-11-16T18:12:25.964+08:00","updated_at":"2022-11-16T18:12:25.964+08:00"},{"id":10462395,"file_name":"bomb.mp3","project_id":460992,"asset_id":582967,"created_at":"2022-11-16T18:12:25.970+08:00","updated_at":"2022-11-16T18:12:25.970+08:00"},{"id":10462396,"file_name":"bgm.mp3","project_id":460992,"asset_id":582968,"created_at":"2022-11-16T18:12:26.095+08:00","updated_at":"2022-11-16T18:12:26.095+08:00"},{"id":10462363,"file_name":"p2_s3.png","project_id":460992,"asset_id":582935,"created_at":"2022-11-16T18:12:25.783+08:00","updated_at":"2022-11-16T18:12:25.783+08:00"},{"id":10462364,"file_name":"p2_s2.png","project_id":460992,"asset_id":582936,"created_at":"2022-11-16T18:12:25.793+08:00","updated_at":"2022-11-16T18:12:25.793+08:00"},{"id":10462365,"file_name":"p2_s1.png","project_id":460992,"asset_id":582937,"created_at":"2022-11-16T18:12:25.798+08:00","updated_at":"2022-11-16T18:12:25.798+08:00"},{"id":10462366,"file_name":"p2_s0.png","project_id":460992,"asset_id":582938,"created_at":"2022-11-16T18:12:25.806+08:00","updated_at":"2022-11-16T18:12:25.806+08:00"},{"id":10462367,"file_name":"p2_balloon.png","project_id":460992,"asset_id":582939,"created_at":"2022-11-16T18:12:25.812+08:00","updated_at":"2022-11-16T18:12:25.812+08:00"},{"id":10462368,"file_name":"p2_5.png","project_id":460992,"asset_id":582940,"created_at":"2022-11-16T18:12:25.817+08:00","updated_at":"2022-11-16T18:12:25.817+08:00"},{"id":10462369,"file_name":"p2_4.png","project_id":460992,"asset_id":582941,"created_at":"2022-11-16T18:12:25.822+08:00","updated_at":"2022-11-16T18:12:25.822+08:00"},{"id":10462370,"file_name":"p2_3.png","project_id":460992,"asset_id":582942,"created_at":"2022-11-16T18:12:25.828+08:00","updated_at":"2022-11-16T18:12:25.828+08:00"},{"id":10462371,"file_name":"p2_2.png","project_id":460992,"asset_id":582943,"created_at":"2022-11-16T18:12:25.832+08:00","updated_at":"2022-11-16T18:12:25.832+08:00"},{"id":10462372,"file_name":"p2_1.png","project_id":460992,"asset_id":582944,"created_at":"2022-11-16T18:12:25.840+08:00","updated_at":"2022-11-16T18:12:25.840+08:00"},{"id":10462373,"file_name":"p2_0.png","project_id":460992,"asset_id":582945,"created_at":"2022-11-16T18:12:25.845+08:00","updated_at":"2022-11-16T18:12:25.845+08:00"},{"id":10462374,"file_name":"p1_s3.png","project_id":460992,"asset_id":582946,"created_at":"2022-11-16T18:12:25.850+08:00","updated_at":"2022-11-16T18:12:25.850+08:00"},{"id":10462375,"file_name":"p1_s2.png","project_id":460992,"asset_id":582947,"created_at":"2022-11-16T18:12:25.854+08:00","updated_at":"2022-11-16T18:12:25.854+08:00"},{"id":10462376,"file_name":"p1_s1.png","project_id":460992,"asset_id":582948,"created_at":"2022-11-16T18:12:25.862+08:00","updated_at":"2022-11-16T18:12:25.862+08:00"},{"id":10462377,"file_name":"p1_s0.png","project_id":460992,"asset_id":582949,"created_at":"2022-11-16T18:12:25.868+08:00","updated_at":"2022-11-16T18:12:25.868+08:00"},{"id":10462378,"file_name":"p1_balloon.png","project_id":460992,"asset_id":582950,"created_at":"2022-11-16T18:12:25.873+08:00","updated_at":"2022-11-16T18:12:25.873+08:00"},{"id":10462379,"file_name":"p1_5.png","project_id":460992,"asset_id":582951,"created_at":"2022-11-16T18:12:25.879+08:00","updated_at":"2022-11-16T18:12:25.879+08:00"},{"id":10462380,"file_name":"p1_4.png","project_id":460992,"asset_id":582952,"created_at":"2022-11-16T18:12:25.887+08:00","updated_at":"2022-11-16T18:12:25.887+08:00"},{"id":10462381,"file_name":"p1_1.png","project_id":460992,"asset_id":582953,"created_at":"2022-11-16T18:12:25.892+08:00","updated_at":"2022-11-16T18:12:25.892+08:00"},{"id":10462382,"file_name":"p1_2.png","project_id":460992,"asset_id":582954,"created_at":"2022-11-16T18:12:25.896+08:00","updated_at":"2022-11-16T18:12:25.896+08:00"},{"id":10462383,"file_name":"p1_3.png","project_id":460992,"asset_id":582955,"created_at":"2022-11-16T18:12:25.900+08:00","updated_at":"2022-11-16T18:12:25.900+08:00"},{"id":10462384,"file_name":"p1_0.png","project_id":460992,"asset_id":582956,"created_at":"2022-11-16T18:12:25.905+08:00","updated_at":"2022-11-16T18:12:25.905+08:00"},{"id":10462385,"file_name":"btn_1p.png","project_id":460992,"asset_id":582957,"created_at":"2022-11-16T18:12:25.910+08:00","updated_at":"2022-11-16T18:12:25.910+08:00"},{"id":10462386,"file_name":"info.png","project_id":460992,"asset_id":582958,"created_at":"2022-11-16T18:12:25.916+08:00","updated_at":"2022-11-16T18:12:25.916+08:00"},{"id":10462387,"file_name":"1.png","project_id":460992,"asset_id":582959,"created_at":"2022-11-16T18:12:25.924+08:00","updated_at":"2022-11-16T18:12:25.924+08:00"},{"id":10462388,"file_name":"2.png","project_id":460992,"asset_id":582960,"created_at":"2022-11-16T18:12:25.928+08:00","updated_at":"2022-11-16T18:12:25.928+08:00"},{"id":10462389,"file_name":"3.png","project_id":460992,"asset_id":582961,"created_at":"2022-11-16T18:12:25.933+08:00","updated_at":"2022-11-16T18:12:25.933+08:00"},{"id":10462390,"file_name":"4.png","project_id":460992,"asset_id":582962,"created_at":"2022-11-16T18:12:25.938+08:00","updated_at":"2022-11-16T18:12:25.938+08:00"},{"id":10462391,"file_name":"5.png","project_id":460992,"asset_id":582963,"created_at":"2022-11-16T18:12:25.946+08:00","updated_at":"2022-11-16T18:12:25.946+08:00"},{"id":10462392,"file_name":"btn_2p.png","project_id":460992,"asset_id":582964,"created_at":"2022-11-16T18:12:25.950+08:00","updated_at":"2022-11-16T18:12:25.950+08:00"},{"id":10462393,"file_name":"bg.png","project_id":460992,"asset_id":582965,"created_at":"2022-11-16T18:12:25.959+08:00","updated_at":"2022-11-16T18:12:25.959+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦