{"id":516593,"student_id":1444,"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\n\n//遊戲主迴圈\nfunction gameloop () {\n //如果 p1 水球放大超過原圖尺寸\n if (p2_balloon.scale \u003e 1) {\n p2.costumeId = 4; //p1 切換獲勝圖\n p1.costumeId = 5; //p1 切換失敗圖\n p2_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) {\n number.hidden = true;\n p1_hint.costumeId = 1; //預設亮起 Z 按鍵\n p2_hint.costumeId = 1; //預設亮起 I 按鍵\n }\n //遊戲說明隱藏才開始紀錄迴圈次數\n if (info.hidden) {\n clock++;\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\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 == 1) {\n p2.costumeId = 2;\n p2_hint.costumeId = 2;\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\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":"2023-04-11T20:23:35.183+08:00","updated_at":"2023-04-11T21:10:33.462+08:00","name":"叩叮灌水球(預設版) 副本","language":"javascript","screenshot":{"url":"https://cdn1.koding.school/uploads/project/screenshot/516593/1aeb1031d2d9cc7a6af0a520acb62765.jpg"},"parent_id":470336,"plugin":"Game.set({width: 1200, height: 900})","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":52,"hashid":"6rps2j5nw","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":11761060,"file_name":"p2_s3.png","project_id":516593,"asset_id":588723,"created_at":"2023-04-11T20:23:35.192+08:00","updated_at":"2023-04-11T20:23:35.192+08:00"},{"id":11761061,"file_name":"p2_s2.png","project_id":516593,"asset_id":588724,"created_at":"2023-04-11T20:23:35.195+08:00","updated_at":"2023-04-11T20:23:35.195+08:00"},{"id":11761062,"file_name":"p2_s1.png","project_id":516593,"asset_id":588725,"created_at":"2023-04-11T20:23:35.196+08:00","updated_at":"2023-04-11T20:23:35.196+08:00"},{"id":11761063,"file_name":"p2_s0.png","project_id":516593,"asset_id":588726,"created_at":"2023-04-11T20:23:35.197+08:00","updated_at":"2023-04-11T20:23:35.197+08:00"},{"id":11761064,"file_name":"p2_balloon.png","project_id":516593,"asset_id":588727,"created_at":"2023-04-11T20:23:35.198+08:00","updated_at":"2023-04-11T20:23:35.198+08:00"},{"id":11761065,"file_name":"p2_5.png","project_id":516593,"asset_id":588728,"created_at":"2023-04-11T20:23:35.200+08:00","updated_at":"2023-04-11T20:23:35.200+08:00"},{"id":11761066,"file_name":"p2_4.png","project_id":516593,"asset_id":588729,"created_at":"2023-04-11T20:23:35.202+08:00","updated_at":"2023-04-11T20:23:35.202+08:00"},{"id":11761067,"file_name":"p2_3.png","project_id":516593,"asset_id":588730,"created_at":"2023-04-11T20:23:35.203+08:00","updated_at":"2023-04-11T20:23:35.203+08:00"},{"id":11761068,"file_name":"p2_2.png","project_id":516593,"asset_id":588731,"created_at":"2023-04-11T20:23:35.205+08:00","updated_at":"2023-04-11T20:23:35.205+08:00"},{"id":11761069,"file_name":"p2_1.png","project_id":516593,"asset_id":588732,"created_at":"2023-04-11T20:23:35.206+08:00","updated_at":"2023-04-11T20:23:35.206+08:00"},{"id":11761070,"file_name":"p2_0.png","project_id":516593,"asset_id":588733,"created_at":"2023-04-11T20:23:35.208+08:00","updated_at":"2023-04-11T20:23:35.208+08:00"},{"id":11761071,"file_name":"p1_s3.png","project_id":516593,"asset_id":588734,"created_at":"2023-04-11T20:23:35.209+08:00","updated_at":"2023-04-11T20:23:35.209+08:00"},{"id":11761072,"file_name":"p1_s2.png","project_id":516593,"asset_id":588735,"created_at":"2023-04-11T20:23:35.211+08:00","updated_at":"2023-04-11T20:23:35.211+08:00"},{"id":11761073,"file_name":"p1_s1.png","project_id":516593,"asset_id":588736,"created_at":"2023-04-11T20:23:35.212+08:00","updated_at":"2023-04-11T20:23:35.212+08:00"},{"id":11761074,"file_name":"p1_s0.png","project_id":516593,"asset_id":588737,"created_at":"2023-04-11T20:23:35.214+08:00","updated_at":"2023-04-11T20:23:35.214+08:00"},{"id":11761075,"file_name":"p1_balloon.png","project_id":516593,"asset_id":588738,"created_at":"2023-04-11T20:23:35.215+08:00","updated_at":"2023-04-11T20:23:35.215+08:00"},{"id":11761076,"file_name":"p1_5.png","project_id":516593,"asset_id":588739,"created_at":"2023-04-11T20:23:35.216+08:00","updated_at":"2023-04-11T20:23:35.216+08:00"},{"id":11761077,"file_name":"p1_4.png","project_id":516593,"asset_id":588740,"created_at":"2023-04-11T20:23:35.217+08:00","updated_at":"2023-04-11T20:23:35.217+08:00"},{"id":11761078,"file_name":"p1_1.png","project_id":516593,"asset_id":588741,"created_at":"2023-04-11T20:23:35.218+08:00","updated_at":"2023-04-11T20:23:35.218+08:00"},{"id":11761079,"file_name":"p1_2.png","project_id":516593,"asset_id":588742,"created_at":"2023-04-11T20:23:35.219+08:00","updated_at":"2023-04-11T20:23:35.219+08:00"},{"id":11761080,"file_name":"p1_3.png","project_id":516593,"asset_id":588743,"created_at":"2023-04-11T20:23:35.221+08:00","updated_at":"2023-04-11T20:23:35.221+08:00"},{"id":11761081,"file_name":"p1_0.png","project_id":516593,"asset_id":588744,"created_at":"2023-04-11T20:23:35.223+08:00","updated_at":"2023-04-11T20:23:35.223+08:00"},{"id":11761082,"file_name":"btn_1p.png","project_id":516593,"asset_id":588745,"created_at":"2023-04-11T20:23:35.224+08:00","updated_at":"2023-04-11T20:23:35.224+08:00"},{"id":11761083,"file_name":"1.png","project_id":516593,"asset_id":588747,"created_at":"2023-04-11T20:23:35.226+08:00","updated_at":"2023-04-11T20:23:35.226+08:00"},{"id":11761084,"file_name":"2.png","project_id":516593,"asset_id":588748,"created_at":"2023-04-11T20:23:35.227+08:00","updated_at":"2023-04-11T20:23:35.227+08:00"},{"id":11761085,"file_name":"3.png","project_id":516593,"asset_id":588749,"created_at":"2023-04-11T20:23:35.228+08:00","updated_at":"2023-04-11T20:23:35.228+08:00"},{"id":11761086,"file_name":"4.png","project_id":516593,"asset_id":588750,"created_at":"2023-04-11T20:23:35.229+08:00","updated_at":"2023-04-11T20:23:35.229+08:00"},{"id":11761087,"file_name":"5.png","project_id":516593,"asset_id":588751,"created_at":"2023-04-11T20:23:35.231+08:00","updated_at":"2023-04-11T20:23:35.231+08:00"},{"id":11761088,"file_name":"btn_2p.png","project_id":516593,"asset_id":588752,"created_at":"2023-04-11T20:23:35.233+08:00","updated_at":"2023-04-11T20:23:35.233+08:00"},{"id":11761089,"file_name":"bg.png","project_id":516593,"asset_id":588753,"created_at":"2023-04-11T20:23:35.234+08:00","updated_at":"2023-04-11T20:23:35.234+08:00"},{"id":11761090,"file_name":"pump.mp3","project_id":516593,"asset_id":588754,"created_at":"2023-04-11T20:23:35.236+08:00","updated_at":"2023-04-11T20:23:35.236+08:00"},{"id":11761091,"file_name":"bomb.mp3","project_id":516593,"asset_id":588755,"created_at":"2023-04-11T20:23:35.237+08:00","updated_at":"2023-04-11T20:23:35.237+08:00"},{"id":11761092,"file_name":"bgm.mp3","project_id":516593,"asset_id":588756,"created_at":"2023-04-11T20:23:35.238+08:00","updated_at":"2023-04-11T20:23:35.238+08:00"},{"id":11761093,"file_name":"info.png","project_id":516593,"asset_id":594366,"created_at":"2023-04-11T20:23:35.240+08:00","updated_at":"2023-04-11T20:23:35.240+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦