{"id":460704,"student_id":10,"content":"setBackdrop('bg.png'); //設定背景\nlet player = createSprite('p_0.png', 'p_1.png', 'p_2.png', 'p_3.png', 'p_4.png', 'p_5.png'); //玩家\nlet mom = createSprite('dad_0.png', 'dad_1.png'); //鵝爸爸\nlet dad = createSprite('mom_0.png', 'mom_1.png'); //鵝媽媽\nlet info = createSprite('info.png'); //遊戲說明\n\nlet count = 0; //推車\nlet total = 0; //完成數\nlet clock = 0; //遊戲迴圈執行次數\nlet babies = []; //存放所有小鵝的陣列\n\nplayer.moveTo(1000, 450); //移動到出口\nmom.moveTo(200, 200); //移動左上角\ndad.moveTo(200, 700); //移動左下角\n\ninfo.layer = 1; //避免遊戲說明被蓋住\n\n//設定角色圖片水平翻轉屬性\nplayer.rotationStyle = 'flipped';\nmom.rotationStyle = 'flipped';\ndad.rotationStyle = 'flipped';\n\ncreateSound('bgm.mp3');\n\nlet baby = createSprite('baby_0.png', 'baby_1.png'); //創造鵝寶寶\nbaby.x = Math.random() * 800 + 200; //隨機水平位置\nbaby.y = Math.random() * 700 + 100; //隨機垂直位置\nbaby.rotationStyle = 'flipped'; //圖片水平翻轉屬性\nbabies.push(baby); //角色存入陣列中\n\n// 遊戲主迴圈\nfunction gameloop () {\n if (info.hidden) {\n updatePlayer(); //更新玩家\n updateParents(); //更新鵝爸媽\n updateBaby(baby); //更新鵝寶寶\n animation(); //走路動畫\n // checkIsGameover(); //確認遊戲是否結束\n clock++; //紀錄遊戲迴圈執行次數加一\n }\n if (cursor.isDown) {\n info.hidden = true; //隱藏遊戲說明\n }\n}\n\n// 更新叩叮玩家\nfunction updatePlayer () {\n // player.toward(cursor);\n // player.stepForward(6);\n\n // if (player.x \u003e 1000 \u0026\u0026 player.y \u003e 300 \u0026\u0026 player.y \u003c 600 \u0026\u0026 count \u003e 0) {\n // total += count;\n // count = 0;\n // createSound('drop.mp3');\n // }\n // inBox(player); //限制叩叮在柵欄內\n}\n\n// 更新鵝媽媽與鵝爸爸\nfunction updateParents () {\n // mom.toward(player);\n // mom.stepForward(2);\n // dad.toward(player);\n // dad.stepForward(2);\n // inBox(dad); //限制鵝爸爸在柵欄內\n}\n\n// 更新鵝寶寶\nfunction updateBaby(baby) {\n // baby.toward(mom);\n // baby.stepForward(2);\n\n // if (player.touched(baby) \u0026\u0026 count \u003c 10) {\n // baby.destroy();\n // count += 1;\n // createSound('pick.mp3');\n // }\n // inBox(baby); //限制鵝寶寶在柵欄內\n}\n\n// 走路動畫\nfunction animation () {\n // 遊戲迴圈每執行 20 次就切換一次左右腳的圖\n let id = clock % 20 \u003e 10 ? 0: 1;\n player.costumeId = id;\n mom.costumeId = id;\n dad.costumeId = id;\n // 將鵝寶寶逐一取出並切換動畫\n for (let i = 0; i \u003c babies.length; i++) {\n babies[i].costumeId = id;\n }\n\n if (count \u003e= 1) player.costumeId += 2; //數量超過 1 就在造型 2 和 3 之間切換\n if (count == 10) player.costumeId += 2; //數量達到 10 就在造型 4 和 5 之間切換\n}\n\n// 確認遊戲是否結束\nfunction checkIsGameover () {\n // 如果碰到鵝媽媽或鵝爸爸\n if (player.touched(mom) || player.touched(dad)) {\n createSprite('fail.png'); //顯示失敗圖\n stop(); //停止遊戲\n createSound('fail.mp3'); //播放失敗音效\n }\n\n // 如果時間到了\n if (clock \u003e= 3600) {\n createSprite('timesup.png'); //顯示時間到圖\n stop(); //停止遊戲\n createSound('fail.mp3'); //播放失敗音效\n }\n \n // 如果收集到 30 隻鵝寶寶\n if (total == 30) {\n createSprite('success.png'); //顯示獲勝圖\n stop(); //停止遊戲\n createSound('win.mp3'); //播放獲勝音效\n }\n}\n\n// 限制角色在柵欄內\nfunction inBox (s) {\n if (s.x \u003e 1100) s.x = 1100;\n if (s.y \u003e 800) s.y = 800;\n if (s.x \u003c 100) s.x = 100;\n if (s.y \u003c 100) s.y = 100;\n}\n\nforever(gameloop); //重複不斷執行遊戲迴圈","created_at":"2022-11-14T11:55:45.834+08:00","updated_at":"2022-11-14T11:55:45.834+08:00","name":"叩叮捉小鵝(預設版) 副本","language":"javascript","screenshot":{"url":null},"parent_id":460703,"plugin":"Game.set({\n width: 1200, height: 900\n})","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":124,"hashid":"rdvs4mkyz","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":10457473,"file_name":"p_2.png","project_id":460704,"asset_id":581803,"created_at":"2022-11-14T11:55:45.841+08:00","updated_at":"2022-11-14T11:55:45.841+08:00"},{"id":10457474,"file_name":"p_1.png","project_id":460704,"asset_id":581804,"created_at":"2022-11-14T11:55:45.843+08:00","updated_at":"2022-11-14T11:55:45.843+08:00"},{"id":10457475,"file_name":"p_0.png","project_id":460704,"asset_id":581805,"created_at":"2022-11-14T11:55:45.844+08:00","updated_at":"2022-11-14T11:55:45.844+08:00"},{"id":10457476,"file_name":"fail.png","project_id":460704,"asset_id":581806,"created_at":"2022-11-14T11:55:45.845+08:00","updated_at":"2022-11-14T11:55:45.845+08:00"},{"id":10457477,"file_name":"bg.png","project_id":460704,"asset_id":581807,"created_at":"2022-11-14T11:55:45.846+08:00","updated_at":"2022-11-14T11:55:45.846+08:00"},{"id":10457478,"file_name":"baby_1.png","project_id":460704,"asset_id":581808,"created_at":"2022-11-14T11:55:45.848+08:00","updated_at":"2022-11-14T11:55:45.848+08:00"},{"id":10457479,"file_name":"baby_0.png","project_id":460704,"asset_id":581809,"created_at":"2022-11-14T11:55:45.849+08:00","updated_at":"2022-11-14T11:55:45.849+08:00"},{"id":10457480,"file_name":"win.mp3","project_id":460704,"asset_id":581810,"created_at":"2022-11-14T11:55:45.850+08:00","updated_at":"2022-11-14T11:55:45.850+08:00"},{"id":10457481,"file_name":"fail.mp3","project_id":460704,"asset_id":581811,"created_at":"2022-11-14T11:55:45.851+08:00","updated_at":"2022-11-14T11:55:45.851+08:00"},{"id":10457482,"file_name":"dad_1.png","project_id":460704,"asset_id":581812,"created_at":"2022-11-14T11:55:45.852+08:00","updated_at":"2022-11-14T11:55:45.852+08:00"},{"id":10457483,"file_name":"mom_1.png","project_id":460704,"asset_id":581813,"created_at":"2022-11-14T11:55:45.853+08:00","updated_at":"2022-11-14T11:55:45.853+08:00"},{"id":10457484,"file_name":"mom_0.png","project_id":460704,"asset_id":581814,"created_at":"2022-11-14T11:55:45.854+08:00","updated_at":"2022-11-14T11:55:45.854+08:00"},{"id":10457485,"file_name":"dad_0.png","project_id":460704,"asset_id":581815,"created_at":"2022-11-14T11:55:45.855+08:00","updated_at":"2022-11-14T11:55:45.855+08:00"},{"id":10457486,"file_name":"pick.mp3","project_id":460704,"asset_id":581816,"created_at":"2022-11-14T11:55:45.856+08:00","updated_at":"2022-11-14T11:55:45.856+08:00"},{"id":10457487,"file_name":"drop.mp3","project_id":460704,"asset_id":581817,"created_at":"2022-11-14T11:55:45.857+08:00","updated_at":"2022-11-14T11:55:45.857+08:00"},{"id":10457488,"file_name":"bgm.mp3","project_id":460704,"asset_id":581818,"created_at":"2022-11-14T11:55:45.858+08:00","updated_at":"2022-11-14T11:55:45.858+08:00"},{"id":10457489,"file_name":"timesup.png","project_id":460704,"asset_id":581819,"created_at":"2022-11-14T11:55:45.859+08:00","updated_at":"2022-11-14T11:55:45.859+08:00"},{"id":10457490,"file_name":"success.png","project_id":460704,"asset_id":581820,"created_at":"2022-11-14T11:55:45.860+08:00","updated_at":"2022-11-14T11:55:45.860+08:00"},{"id":10457491,"file_name":"p_5.png","project_id":460704,"asset_id":581821,"created_at":"2022-11-14T11:55:45.861+08:00","updated_at":"2022-11-14T11:55:45.861+08:00"},{"id":10457492,"file_name":"p_4.png","project_id":460704,"asset_id":581822,"created_at":"2022-11-14T11:55:45.862+08:00","updated_at":"2022-11-14T11:55:45.862+08:00"},{"id":10457493,"file_name":"p_3.png","project_id":460704,"asset_id":581823,"created_at":"2022-11-14T11:55:45.863+08:00","updated_at":"2022-11-14T11:55:45.863+08:00"},{"id":10457494,"file_name":"info.png","project_id":460704,"asset_id":581824,"created_at":"2022-11-14T11:55:45.865+08:00","updated_at":"2022-11-14T11:55:45.865+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦