{"id":473509,"student_id":10,"content":"createSprite('bg.png'); //設定背景圖\nlet board = createSprite('board.png'); //木板\nlet tongueR = createSprite('tongue_r_1.png', 'tongue_r_2.png'); //紅色青蛙的舌頭\nlet tongueB = createSprite('tongue_b_1.png', 'tongue_b_2.png'); //藍色青蛙的舌頭\nlet frogR = createSprite('frog_r_0.png', 'frog_r_1.png'); //紅色青蛙\nlet frogB = createSprite('frog_b_0.png', 'frog_b_1.png'); //藍色青蛙\nlet fly1 = createSprite('fly_r.png', 'fly_b.png', 'fly_k_0.png', 'fly_k_1.png'); //目標1\nlet fly2 = createSprite('fly_r.png', 'fly_b.png', 'fly_k_0.png', 'fly_k_1.png'); //目標2\nlet fly3 = createSprite('fly_r.png', 'fly_b.png', 'fly_k_0.png', 'fly_k_1.png'); //目標3\nlet fly4 = createSprite('fly_r.png', 'fly_b.png', 'fly_k_0.png', 'fly_k_1.png'); //目標4\nlet fly5 = createSprite('fly_r.png', 'fly_b.png', 'fly_k_0.png', 'fly_k_1.png'); //目標5\nlet info = createSprite('info.png'); //遊戲說明\ninfo.hidden = true; // 預設隱藏遊戲說明\n\nlet vyR = 0; //紅色舌頭的速度\nlet vyB = 0; //藍色舌頭的速度\nlet score = 0; //分數\nlet clock = 0; //迴圈次數\n\ntongueR.moveTo(150, 700);\ntongueB.moveTo(450, 700);\nfrogR.moveTo(150, 750);\nfrogB.moveTo(450, 750);\nfly1.moveTo(0 + 150, 200);\nfly2.moveTo(300 + 150, 200);\nfly3.moveTo(600 + 150, 200);\nfly4.moveTo(900 + 150, 200);\nfly5.moveTo(1200 + 150, 200);\n\n// 播放背景音樂\n// createSound('bgm.mp3', true);\n\n// 遊戲主迴圈\nfunction gameloop () {\n\n // 計算剩餘時間\n let timer = Math.floor(60 - clock / 60);\n\n // 如果剩餘時間到了就結束遊戲\n if (timer \u003c= 0) {\n createSprite('timeout.png');\n stop();\n }\n\n // 印出剩餘時間與分數\n print('剩餘時間: ' + timer, 740, 700, 'black', 40);\n print('捕捉成功: ' + score, 740, 760, 'white', 40);\n\n updateTongues(); //更新青蛙舌頭位置\n\n updateFly(fly1);\n updateFly(fly2);\n updateFly(fly3);\n updateFly(fly4);\n updateFly(fly5);\n\n // fly1.x = fly1.x - 15;\n // if (fly1.x \u003c= -150) {\n // fly1.x = fly1.x + 300 * 5; // 重置到場景右側\n // fly1.costumeId = Math.floor(Math.random() * 3); //隨機切換圖片\n // fly1.hidden = false; // 重新顯示蜻蜓\n // }\n}\n\n// 更新蜻蜓角色\nfunction updateFly(fly) {\n\n\n // if (fly.costumeId == 0 \u0026\u0026 fly.touched(tongueR)) {\n // fly.hidden = true; // 隱藏蜻蜓\n // tongueR.costumeId = 1; // 舌頭黏到蜻蜓\n // score++; // 分數加一\n // }\n\n // if (fly.costumeId == 2 \u0026\u0026 fly.touched(tongueR)) {\n // frogR.costumeId = 1; //紅色青蛙切驚嚇\n // fly.costumeId = 3; //叩叮蜻蜓生氣\n // stop(); //停止遊戲\n // createSound('fail.mp3');\n // }\n}\n\n// 更新青蛙舌頭位置\nfunction updateTongues () {\n tongueR.y += vyR; // 根據數值改變垂直位置\n if (tongueR.y \u003c 200) {\n vyR = 50; // 往下移動\n }\n if (key.o \u0026\u0026 tongueR.y \u003e= 700) {\n vyR = -50; //往上移動\n tongueR.y = 700; //發射前位置\n tongueR.costumeId = 0; //恢復造型\n createSound('shoot.mp3');\n }\n\n tongueB.y += vyB; // 根據數值改變垂直位置\n if (tongueB.y \u003c 200) {\n vyB = 50; // 往下移動\n }\n if (key.p \u0026\u0026 tongueB.y \u003e= 700) {\n vyB = -50; //往上移動\n tongueB.y = 700; //發射前位置\n tongueB.costumeId = 0; //恢復造型\n createSound('shoot.mp3');\n }\n}\n\nforever(gameloop); //不斷執行遊戲迴圈","created_at":"2022-12-16T16:26:07.156+08:00","updated_at":"2022-12-17T09:44:04.901+08:00","name":"補蜻蜓大作戰(預設版). 副本","language":"javascript","screenshot":{"url":"https://cdn0.koding.school/uploads/project/screenshot/473509/386fbc3df8cb24dbb1a1ef07cafe0549.jpg"},"parent_id":467003,"plugin":"Game.set({width: 1200, height: 900})","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":109,"hashid":"jzmskdkve","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":10771536,"file_name":"timeout.png","project_id":473509,"asset_id":586576,"created_at":"2022-12-16T16:26:07.162+08:00","updated_at":"2022-12-16T16:26:07.162+08:00"},{"id":10771537,"file_name":"fail.mp3","project_id":473509,"asset_id":586577,"created_at":"2022-12-16T16:26:07.165+08:00","updated_at":"2022-12-16T16:26:07.165+08:00"},{"id":10771538,"file_name":"fly_k_1.png","project_id":473509,"asset_id":586578,"created_at":"2022-12-16T16:26:07.166+08:00","updated_at":"2022-12-16T16:26:07.166+08:00"},{"id":10771539,"file_name":"tongue_r_2.png","project_id":473509,"asset_id":586579,"created_at":"2022-12-16T16:26:07.167+08:00","updated_at":"2022-12-16T16:26:07.167+08:00"},{"id":10771540,"file_name":"tongue_r_1.png","project_id":473509,"asset_id":586580,"created_at":"2022-12-16T16:26:07.168+08:00","updated_at":"2022-12-16T16:26:07.168+08:00"},{"id":10771541,"file_name":"tongue_b_2.png","project_id":473509,"asset_id":586581,"created_at":"2022-12-16T16:26:07.170+08:00","updated_at":"2022-12-16T16:26:07.170+08:00"},{"id":10771542,"file_name":"tongue_b_1.png","project_id":473509,"asset_id":586582,"created_at":"2022-12-16T16:26:07.171+08:00","updated_at":"2022-12-16T16:26:07.171+08:00"},{"id":10771543,"file_name":"fly_k_0.png","project_id":473509,"asset_id":586583,"created_at":"2022-12-16T16:26:07.172+08:00","updated_at":"2022-12-16T16:26:07.172+08:00"},{"id":10771544,"file_name":"fly_b.png","project_id":473509,"asset_id":586584,"created_at":"2022-12-16T16:26:07.174+08:00","updated_at":"2022-12-16T16:26:07.174+08:00"},{"id":10771545,"file_name":"fly_r.png","project_id":473509,"asset_id":586585,"created_at":"2022-12-16T16:26:07.175+08:00","updated_at":"2022-12-16T16:26:07.175+08:00"},{"id":10771546,"file_name":"info.png","project_id":473509,"asset_id":586586,"created_at":"2022-12-16T16:26:07.176+08:00","updated_at":"2022-12-16T16:26:07.176+08:00"},{"id":10771547,"file_name":"frog_r_1.png","project_id":473509,"asset_id":586587,"created_at":"2022-12-16T16:26:07.177+08:00","updated_at":"2022-12-16T16:26:07.177+08:00"},{"id":10771548,"file_name":"frog_r_0.png","project_id":473509,"asset_id":586588,"created_at":"2022-12-16T16:26:07.178+08:00","updated_at":"2022-12-16T16:26:07.178+08:00"},{"id":10771549,"file_name":"frog_b_1.png","project_id":473509,"asset_id":586589,"created_at":"2022-12-16T16:26:07.179+08:00","updated_at":"2022-12-16T16:26:07.179+08:00"},{"id":10771550,"file_name":"frog_b_0.png","project_id":473509,"asset_id":586590,"created_at":"2022-12-16T16:26:07.180+08:00","updated_at":"2022-12-16T16:26:07.180+08:00"},{"id":10771551,"file_name":"board.png","project_id":473509,"asset_id":586591,"created_at":"2022-12-16T16:26:07.182+08:00","updated_at":"2022-12-16T16:26:07.182+08:00"},{"id":10771552,"file_name":"bg.png","project_id":473509,"asset_id":586592,"created_at":"2022-12-16T16:26:07.183+08:00","updated_at":"2022-12-16T16:26:07.183+08:00"},{"id":10771553,"file_name":"bgm.mp3","project_id":473509,"asset_id":586593,"created_at":"2022-12-16T16:26:07.184+08:00","updated_at":"2022-12-16T16:26:07.184+08:00"},{"id":10771554,"file_name":"shoot.mp3","project_id":473509,"asset_id":586594,"created_at":"2022-12-16T16:26:07.185+08:00","updated_at":"2022-12-16T16:26:07.185+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦