{"id":315303,"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 countdown = createSprite(\"5.png\", \"4.png\", \"3.png\", \"2.png\", \"1.png\"); // 倒數計時\nlet info = createSprite(\"info.png\"); // 遊戲說明\nlet btn_1 = createSprite(\"btn_1p.png\"); // 「PK 電腦」選項\nlet btn_2 = createSprite(\"btn_2p.png\"); // 「雙人對戰」選項\n\nlet clock = 0; // 紀錄遊戲迴圈執行的次數\nlet auto = false; // 是否是 1p 選項\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);\np1_balloon.scale = 0.3;\np2_balloon.scale = 0.3;\n\ncreateSound('bgm.mp3', true);\n\nfunction gameloop () {\n \n if (p1_balloon.scale \u003e 1) {\n p1.costumeId = 4;\n p2.costumeId = 5;\n p1_balloon.hidden = true;\n stop();\n createSound('bomb.mp3');\n }\n \n if (p2_balloon.scale \u003e 1) {\n p2.costumeId = 4;\n p1.costumeId = 5;\n p2_balloon.hidden = true;\n stop();\n createSound('bomb.mp3');\n }\n \n if (info.hidden == true) {\n clock++;\n }\n \n if (clock == 60) countdown.costumeId = 1;\n if (clock == 120) countdown.costumeId = 2;\n if (clock == 180) countdown.costumeId = 3;\n if (clock == 240) countdown.costumeId = 4;\n if (clock == 300) {\n countdown.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\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\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\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\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\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\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\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 案件時\n\nforever(gameloop); // 不斷執行遊戲迴圈\n\nbtn_1.on('click' ,function () {\n info.hidden = true;\n btn_1.hidden = true;\n btn_2.hidden = true;\n auto = true;\n});\n\nbtn_2.on('click' ,function () {\n info.hidden = true;\n btn_1.hidden = true;\n btn_2.hidden = true;\n});\n\n","created_at":"2021-11-17T16:33:19.540+08:00","updated_at":"2022-11-16T18:10:24.375+08:00","name":"叩叮灌水球(完整版)","language":"javascript","screenshot":{"url":"https://cdn0.koding.school/uploads/project/screenshot/315303/d5d8d90c50346241ad10934a3bdaf682.jpg"},"parent_id":2,"plugin":"Game.set({width: 1200, height: 900})","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":165,"hashid":"meysw24ry","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":6500191,"file_name":"bgm.mp3","project_id":315303,"asset_id":438252,"created_at":"2021-11-17T16:33:36.731+08:00","updated_at":"2021-11-17T16:33:36.731+08:00"},{"id":6500192,"file_name":"bomb.mp3","project_id":315303,"asset_id":438253,"created_at":"2021-11-17T16:33:36.737+08:00","updated_at":"2021-11-17T16:33:36.737+08:00"},{"id":6500193,"file_name":"pump.mp3","project_id":315303,"asset_id":438254,"created_at":"2021-11-17T16:33:36.741+08:00","updated_at":"2021-11-17T16:33:36.741+08:00"},{"id":6500194,"file_name":"bg.png","project_id":315303,"asset_id":438255,"created_at":"2021-11-17T16:33:36.749+08:00","updated_at":"2021-11-17T16:33:36.749+08:00"},{"id":6500195,"file_name":"btn_2p.png","project_id":315303,"asset_id":438256,"created_at":"2021-11-17T16:33:36.755+08:00","updated_at":"2021-11-17T16:33:36.755+08:00"},{"id":6500196,"file_name":"5.png","project_id":315303,"asset_id":438257,"created_at":"2021-11-17T16:33:36.759+08:00","updated_at":"2021-11-17T16:33:36.759+08:00"},{"id":6500197,"file_name":"4.png","project_id":315303,"asset_id":438258,"created_at":"2021-11-17T16:33:36.764+08:00","updated_at":"2021-11-17T16:33:36.764+08:00"},{"id":6500198,"file_name":"3.png","project_id":315303,"asset_id":438259,"created_at":"2021-11-17T16:33:36.769+08:00","updated_at":"2021-11-17T16:33:36.769+08:00"},{"id":6500199,"file_name":"2.png","project_id":315303,"asset_id":438260,"created_at":"2021-11-17T16:33:36.773+08:00","updated_at":"2021-11-17T16:33:36.773+08:00"},{"id":6500200,"file_name":"1.png","project_id":315303,"asset_id":438261,"created_at":"2021-11-17T16:33:36.778+08:00","updated_at":"2021-11-17T16:33:36.778+08:00"},{"id":6500201,"file_name":"info.png","project_id":315303,"asset_id":438262,"created_at":"2021-11-17T16:33:36.783+08:00","updated_at":"2021-11-17T16:33:36.783+08:00"},{"id":6500202,"file_name":"btn_1p.png","project_id":315303,"asset_id":438263,"created_at":"2021-11-17T16:33:36.787+08:00","updated_at":"2021-11-17T16:33:36.787+08:00"},{"id":6500203,"file_name":"p1_0.png","project_id":315303,"asset_id":438264,"created_at":"2021-11-17T16:33:36.792+08:00","updated_at":"2021-11-17T16:33:36.792+08:00"},{"id":6500204,"file_name":"p1_3.png","project_id":315303,"asset_id":438265,"created_at":"2021-11-17T16:33:36.797+08:00","updated_at":"2021-11-17T16:33:36.797+08:00"},{"id":6500205,"file_name":"p1_2.png","project_id":315303,"asset_id":438266,"created_at":"2021-11-17T16:33:36.801+08:00","updated_at":"2021-11-17T16:33:36.801+08:00"},{"id":6500206,"file_name":"p1_1.png","project_id":315303,"asset_id":438267,"created_at":"2021-11-17T16:33:36.807+08:00","updated_at":"2021-11-17T16:33:36.807+08:00"},{"id":6500207,"file_name":"p1_4.png","project_id":315303,"asset_id":438268,"created_at":"2021-11-17T16:33:36.813+08:00","updated_at":"2021-11-17T16:33:36.813+08:00"},{"id":6500208,"file_name":"p1_5.png","project_id":315303,"asset_id":438269,"created_at":"2021-11-17T16:33:36.820+08:00","updated_at":"2021-11-17T16:33:36.820+08:00"},{"id":6500209,"file_name":"p1_balloon.png","project_id":315303,"asset_id":438270,"created_at":"2021-11-17T16:33:36.827+08:00","updated_at":"2021-11-17T16:33:36.827+08:00"},{"id":6500210,"file_name":"p1_s0.png","project_id":315303,"asset_id":438271,"created_at":"2021-11-17T16:33:36.831+08:00","updated_at":"2021-11-17T16:33:36.831+08:00"},{"id":6500211,"file_name":"p1_s1.png","project_id":315303,"asset_id":438272,"created_at":"2021-11-17T16:33:36.854+08:00","updated_at":"2021-11-17T16:33:36.854+08:00"},{"id":6500212,"file_name":"p1_s2.png","project_id":315303,"asset_id":438273,"created_at":"2021-11-17T16:33:36.859+08:00","updated_at":"2021-11-17T16:33:36.859+08:00"},{"id":6500213,"file_name":"p1_s3.png","project_id":315303,"asset_id":438274,"created_at":"2021-11-17T16:33:36.863+08:00","updated_at":"2021-11-17T16:33:36.863+08:00"},{"id":6500214,"file_name":"p2_0.png","project_id":315303,"asset_id":438275,"created_at":"2021-11-17T16:33:36.868+08:00","updated_at":"2021-11-17T16:33:36.868+08:00"},{"id":6500215,"file_name":"p2_1.png","project_id":315303,"asset_id":438276,"created_at":"2021-11-17T16:33:36.872+08:00","updated_at":"2021-11-17T16:33:36.872+08:00"},{"id":6500216,"file_name":"p2_2.png","project_id":315303,"asset_id":438277,"created_at":"2021-11-17T16:33:36.876+08:00","updated_at":"2021-11-17T16:33:36.876+08:00"},{"id":6500217,"file_name":"p2_3.png","project_id":315303,"asset_id":438278,"created_at":"2021-11-17T16:33:36.880+08:00","updated_at":"2021-11-17T16:33:36.880+08:00"},{"id":6500218,"file_name":"p2_4.png","project_id":315303,"asset_id":438279,"created_at":"2021-11-17T16:33:36.885+08:00","updated_at":"2021-11-17T16:33:36.885+08:00"},{"id":6500219,"file_name":"p2_5.png","project_id":315303,"asset_id":438280,"created_at":"2021-11-17T16:33:36.889+08:00","updated_at":"2021-11-17T16:33:36.889+08:00"},{"id":6500220,"file_name":"p2_balloon.png","project_id":315303,"asset_id":438281,"created_at":"2021-11-17T16:33:36.894+08:00","updated_at":"2021-11-17T16:33:36.894+08:00"},{"id":6500221,"file_name":"p2_s0.png","project_id":315303,"asset_id":438282,"created_at":"2021-11-17T16:33:36.898+08:00","updated_at":"2021-11-17T16:33:36.898+08:00"},{"id":6500222,"file_name":"p2_s1.png","project_id":315303,"asset_id":438283,"created_at":"2021-11-17T16:33:36.902+08:00","updated_at":"2021-11-17T16:33:36.902+08:00"},{"id":6500223,"file_name":"p2_s2.png","project_id":315303,"asset_id":438284,"created_at":"2021-11-17T16:33:36.906+08:00","updated_at":"2021-11-17T16:33:36.906+08:00"},{"id":6500224,"file_name":"p2_s3.png","project_id":315303,"asset_id":438285,"created_at":"2021-11-17T16:33:36.911+08:00","updated_at":"2021-11-17T16:33:36.911+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦