{"id":183379,"student_id":2589,"content":"","created_at":"2020-08-21T11:28:34.181+08:00","updated_at":"2020-08-21T11:28:56.467+08:00","name":"燒烤章魚燒(試玩版)","language":"javascript","screenshot":{"url":null},"parent_id":160539,"plugin":"Game.set({ width: 1200, height: 900 });\n\nsetBackdrop('bg.png'); //背景圖\n\nvar chef = createSprite('k_0.png', 'k_1.png', 'k_2.png', 'k_3.png', 'k_4.png', 'k_5.png', 'k_6.png'); //叩叮主廚\nvar box = createSprite('0.png', '1.png', '2.png', '3.png', '4.png', '5.png'); //盒子\nvar boxs = createSprite('dot.png', '6.png', '12.png', '18.png', '24.png', '30.png', '36.png'); //完成的章魚燒盒子\nvar hand = createSprite('s_00.png', 's_1.png', 's_2.png', 's_3.png'); //鼠標\nvar hint = createSprite('info.png'); //遊戲說明\nvar can = createSprite('can.png'); //垃圾桶\nvar pans = []; //存放九個烤盤角色\nvar score = 0; //完成的章魚燒個數\nvar endTime = Infinity;\n\nbox.moveTo(900, 530);\ncan.moveTo(100, 800);\nboxs.moveTo(600, 800);\nchef.moveTo(900, 160);\nchef.layer = 1;\nhint.layer = 2;\nhand.layer = 3;\n\nforever(loop); //不斷執行遊戲迴圈\nhint.on('click', start); //開始遊戲\ncan.on('click', onClickTrash); //垃圾桶\nbox.on('click', onClickBox); //接盤\n\n//初始化 9 宮格烤盤\nfor (var y = 0; y \u003c 3; y++) {\n for (var x = 0; x \u003c 3; x++) {\n var s = createSprite('p_0.png', 'p_1.png', 'p_2.png', 'p_3.png', 'p_4.png');\n s.x = 180 + x*180;\n s.y = 180 + y*180;\n s.on('click', onClickPan);\n pans.push(s);\n }\n}\n\nvar cook = createSound('cook.ogg', true);\ncreateSound('bgm.mp3', true);\n\n//遊戲迴圈\nfunction loop () {\n\n hand.moveTo(cursor);\n\n var isCooking = false;\n \n for (var i=0; i\u003cpans.length; i++) {\n p = pans[i]\n if (p.costumeId != 0) {\n p.timer--;\n if (p.timer \u003c 0) {\n p.costumeId = 4; //焦掉\n } else if (p.timer \u003c 200) {\n p.costumeId = 3; //全熟\n } else if (p.timer \u003c 400) {\n p.costumeId = 2; //半熟\n } else {\n p.costumeId = 1; //麵糊\n }\n }\n\n //沒有拿東西且碰到烤盤才切換造型\n if (hand.costumeId != 2 \u0026\u0026 hand.costumeId != 3 \u0026\u0026 p.touched(cursor)) {\n if (p.costumeId == 0) {\n hand.costumeId = 0; //切換麵糊杯造型\n } else {\n hand.costumeId = 1; //切換戳針造型\n }\n }\n if (p.costumeId != 0) {\n isCooking = true;\n }\n }\n\n box.costumeId = score % 6;\n boxs.costumeId = Math.floor(score/6);\n chef.costumeId = Math.floor(score/6);\n\n cook.mute(!isCooking);\n \n if (hint.hidden) {\n var r = endTime - Date.now();\n drawText(Math.ceil(r/1000) + '秒', 1000, 780, 'white', 68);\n if (r \u003c= 0 || score == 41) gameover();\n }\n}\n\n//開始遊戲\nfunction start () {\n hint.hidden = true;\n endTime = Date.now() + 60000;\n}\n\n// 烤盤被點擊時執行此函式\nfunction onClickPan () {\n if (hand.costumeId != 2 \u0026\u0026 hand.costumeId != 3 \u0026\u0026 hint.hidden == true) {\n if (this.costumeId == 0) {\n this.costumeId = 1;\n this.timer = 500 + Math.random()*100;\n } else if (this.costumeId == 3) {\n this.costumeId = 0;\n hand.costumeId = 2;\n } else if (this.costumeId == 4) {\n this.costumeId = 0;\n hand.costumeId = 3;\n }\n }\n}\n\n//接盤被點擊時執行此函式\nfunction onClickBox () {\n if (hand.costumeId == 2) {\n hand.costumeId = 0;\n score++;\n createSound('drop.wav');\n }\n}\n\n//垃圾桶被點擊時執行此函式\nfunction onClickTrash () {\n if (hand.costumeId == 2 || hand.costumeId == 3) {\n hand.costumeId = 0;\n createSound('remove.ogg');\n }\n}\n\n//遊戲結束\nfunction gameover () {\n chef.moveTo(600, 450);\n chef.scale = 2;\n chef.layer = 4;\n stop();\n}\n","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":108,"hashid":"rdvsq2wm","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":3118048,"file_name":"can.png","project_id":183379,"asset_id":233350,"created_at":"2020-08-21T11:28:34.214+08:00","updated_at":"2020-08-21T11:28:34.214+08:00"},{"id":3118021,"file_name":"info.png","project_id":183379,"asset_id":233359,"created_at":"2020-08-21T11:28:34.189+08:00","updated_at":"2020-08-21T11:28:34.189+08:00"},{"id":3118022,"file_name":"s_00.png","project_id":183379,"asset_id":233358,"created_at":"2020-08-21T11:28:34.190+08:00","updated_at":"2020-08-21T11:28:34.190+08:00"},{"id":3118023,"file_name":"s_3.png","project_id":183379,"asset_id":233357,"created_at":"2020-08-21T11:28:34.191+08:00","updated_at":"2020-08-21T11:28:34.191+08:00"},{"id":3118024,"file_name":"s_2.png","project_id":183379,"asset_id":233356,"created_at":"2020-08-21T11:28:34.192+08:00","updated_at":"2020-08-21T11:28:34.192+08:00"},{"id":3118025,"file_name":"s_1.png","project_id":183379,"asset_id":233355,"created_at":"2020-08-21T11:28:34.193+08:00","updated_at":"2020-08-21T11:28:34.193+08:00"},{"id":3118026,"file_name":"6.png","project_id":183379,"asset_id":233222,"created_at":"2020-08-21T11:28:34.194+08:00","updated_at":"2020-08-21T11:28:34.194+08:00"},{"id":3118027,"file_name":"48.png","project_id":183379,"asset_id":233348,"created_at":"2020-08-21T11:28:34.195+08:00","updated_at":"2020-08-21T11:28:34.195+08:00"},{"id":3118028,"file_name":"42.png","project_id":183379,"asset_id":233347,"created_at":"2020-08-21T11:28:34.196+08:00","updated_at":"2020-08-21T11:28:34.196+08:00"},{"id":3118029,"file_name":"36.png","project_id":183379,"asset_id":233226,"created_at":"2020-08-21T11:28:34.197+08:00","updated_at":"2020-08-21T11:28:34.197+08:00"},{"id":3118030,"file_name":"30.png","project_id":183379,"asset_id":233346,"created_at":"2020-08-21T11:28:34.197+08:00","updated_at":"2020-08-21T11:28:34.197+08:00"},{"id":3118031,"file_name":"24.png","project_id":183379,"asset_id":233225,"created_at":"2020-08-21T11:28:34.198+08:00","updated_at":"2020-08-21T11:28:34.198+08:00"},{"id":3118032,"file_name":"18.png","project_id":183379,"asset_id":233224,"created_at":"2020-08-21T11:28:34.199+08:00","updated_at":"2020-08-21T11:28:34.199+08:00"},{"id":3118033,"file_name":"12.png","project_id":183379,"asset_id":233223,"created_at":"2020-08-21T11:28:34.200+08:00","updated_at":"2020-08-21T11:28:34.200+08:00"},{"id":3118034,"file_name":"6.png","project_id":183379,"asset_id":233222,"created_at":"2020-08-21T11:28:34.201+08:00","updated_at":"2020-08-21T11:28:34.201+08:00"},{"id":3118035,"file_name":"p_4.png","project_id":183379,"asset_id":233240,"created_at":"2020-08-21T11:28:34.202+08:00","updated_at":"2020-08-21T11:28:34.202+08:00"},{"id":3118036,"file_name":"p_3.png","project_id":183379,"asset_id":233239,"created_at":"2020-08-21T11:28:34.203+08:00","updated_at":"2020-08-21T11:28:34.203+08:00"},{"id":3118037,"file_name":"p_2.png","project_id":183379,"asset_id":233238,"created_at":"2020-08-21T11:28:34.204+08:00","updated_at":"2020-08-21T11:28:34.204+08:00"},{"id":3118038,"file_name":"p_1.png","project_id":183379,"asset_id":233237,"created_at":"2020-08-21T11:28:34.205+08:00","updated_at":"2020-08-21T11:28:34.205+08:00"},{"id":3118039,"file_name":"p_0.png","project_id":183379,"asset_id":233236,"created_at":"2020-08-21T11:28:34.206+08:00","updated_at":"2020-08-21T11:28:34.206+08:00"},{"id":3118040,"file_name":"k_6.png","project_id":183379,"asset_id":233235,"created_at":"2020-08-21T11:28:34.207+08:00","updated_at":"2020-08-21T11:28:34.207+08:00"},{"id":3118041,"file_name":"k_5.png","project_id":183379,"asset_id":233234,"created_at":"2020-08-21T11:28:34.208+08:00","updated_at":"2020-08-21T11:28:34.208+08:00"},{"id":3118042,"file_name":"k_4.png","project_id":183379,"asset_id":233233,"created_at":"2020-08-21T11:28:34.208+08:00","updated_at":"2020-08-21T11:28:34.208+08:00"},{"id":3118043,"file_name":"k_3.png","project_id":183379,"asset_id":233232,"created_at":"2020-08-21T11:28:34.209+08:00","updated_at":"2020-08-21T11:28:34.209+08:00"},{"id":3118044,"file_name":"k_2.png","project_id":183379,"asset_id":233231,"created_at":"2020-08-21T11:28:34.210+08:00","updated_at":"2020-08-21T11:28:34.210+08:00"},{"id":3118045,"file_name":"k_1.png","project_id":183379,"asset_id":233230,"created_at":"2020-08-21T11:28:34.211+08:00","updated_at":"2020-08-21T11:28:34.211+08:00"},{"id":3118046,"file_name":"k_0.png","project_id":183379,"asset_id":233352,"created_at":"2020-08-21T11:28:34.212+08:00","updated_at":"2020-08-21T11:28:34.212+08:00"},{"id":3118047,"file_name":"dot.png","project_id":183379,"asset_id":233228,"created_at":"2020-08-21T11:28:34.213+08:00","updated_at":"2020-08-21T11:28:34.213+08:00"},{"id":3118049,"file_name":"bg.png","project_id":183379,"asset_id":233349,"created_at":"2020-08-21T11:28:34.215+08:00","updated_at":"2020-08-21T11:28:34.215+08:00"},{"id":3118050,"file_name":"5.png","project_id":183379,"asset_id":233246,"created_at":"2020-08-21T11:28:34.216+08:00","updated_at":"2020-08-21T11:28:34.216+08:00"},{"id":3118051,"file_name":"4.png","project_id":183379,"asset_id":233220,"created_at":"2020-08-21T11:28:34.217+08:00","updated_at":"2020-08-21T11:28:34.217+08:00"},{"id":3118052,"file_name":"3.png","project_id":183379,"asset_id":233219,"created_at":"2020-08-21T11:28:34.218+08:00","updated_at":"2020-08-21T11:28:34.218+08:00"},{"id":3118053,"file_name":"2.png","project_id":183379,"asset_id":233345,"created_at":"2020-08-21T11:28:34.219+08:00","updated_at":"2020-08-21T11:28:34.219+08:00"},{"id":3118054,"file_name":"1.png","project_id":183379,"asset_id":233218,"created_at":"2020-08-21T11:28:34.220+08:00","updated_at":"2020-08-21T11:28:34.220+08:00"},{"id":3118055,"file_name":"0.png","project_id":183379,"asset_id":233245,"created_at":"2020-08-21T11:28:34.220+08:00","updated_at":"2020-08-21T11:28:34.220+08:00"},{"id":3118056,"file_name":"cook.ogg","project_id":183379,"asset_id":233251,"created_at":"2020-08-21T11:28:34.221+08:00","updated_at":"2020-08-21T11:28:34.221+08:00"},{"id":3118057,"file_name":"drop.wav","project_id":183379,"asset_id":233250,"created_at":"2020-08-21T11:28:34.222+08:00","updated_at":"2020-08-21T11:28:34.222+08:00"},{"id":3118058,"file_name":"bgm.mp3","project_id":183379,"asset_id":233249,"created_at":"2020-08-21T11:28:34.223+08:00","updated_at":"2020-08-21T11:28:34.223+08:00"},{"id":3118059,"file_name":"remove.ogg","project_id":183379,"asset_id":233248,"created_at":"2020-08-21T11:28:34.224+08:00","updated_at":"2020-08-21T11:28:34.224+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦