{"id":160539,"student_id":10,"content":"setBackdrop('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() + 6000;\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","created_at":"2020-06-29T09:53:30.713+08:00","updated_at":"2022-04-28T16:45:46.061+08:00","name":"燒烤章魚燒(完整版)","language":"javascript","screenshot":{"url":"https://cdn5.koding.school/uploads/project/screenshot/160539/5653846db1d012e27bef7a392c1f3af0.jpg"},"parent_id":2,"plugin":"Game.set({ width: 1200, height: 900 });","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":257,"hashid":"yeys9rzj","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":2794149,"file_name":"4.png","project_id":160539,"asset_id":233220,"created_at":"2020-06-30T17:39:39.693+08:00","updated_at":"2020-06-30T17:39:39.693+08:00"},{"id":2794150,"file_name":"5.png","project_id":160539,"asset_id":233246,"created_at":"2020-06-30T17:39:39.694+08:00","updated_at":"2020-06-30T17:39:39.694+08:00"},{"id":2794182,"file_name":"18.png","project_id":160539,"asset_id":233224,"created_at":"2020-06-30T17:41:28.483+08:00","updated_at":"2020-06-30T17:41:28.483+08:00"},{"id":2794183,"file_name":"24.png","project_id":160539,"asset_id":233225,"created_at":"2020-06-30T17:41:28.485+08:00","updated_at":"2020-06-30T17:41:28.485+08:00"},{"id":2794164,"file_name":"k_0.png","project_id":160539,"asset_id":233352,"created_at":"2020-06-30T17:39:41.249+08:00","updated_at":"2020-06-30T17:39:41.249+08:00"},{"id":2794165,"file_name":"k_1.png","project_id":160539,"asset_id":233230,"created_at":"2020-06-30T17:39:41.439+08:00","updated_at":"2020-06-30T17:39:41.439+08:00"},{"id":2794166,"file_name":"k_2.png","project_id":160539,"asset_id":233231,"created_at":"2020-06-30T17:39:41.441+08:00","updated_at":"2020-06-30T17:39:41.441+08:00"},{"id":2794167,"file_name":"k_3.png","project_id":160539,"asset_id":233232,"created_at":"2020-06-30T17:39:41.629+08:00","updated_at":"2020-06-30T17:39:41.629+08:00"},{"id":2794168,"file_name":"k_4.png","project_id":160539,"asset_id":233233,"created_at":"2020-06-30T17:39:41.631+08:00","updated_at":"2020-06-30T17:39:41.631+08:00"},{"id":2794169,"file_name":"k_5.png","project_id":160539,"asset_id":233234,"created_at":"2020-06-30T17:39:41.822+08:00","updated_at":"2020-06-30T17:39:41.822+08:00"},{"id":2794170,"file_name":"k_6.png","project_id":160539,"asset_id":233235,"created_at":"2020-06-30T17:39:41.824+08:00","updated_at":"2020-06-30T17:39:41.824+08:00"},{"id":2794175,"file_name":"p_4.png","project_id":160539,"asset_id":233240,"created_at":"2020-06-30T17:39:42.385+08:00","updated_at":"2020-06-30T17:39:42.385+08:00"},{"id":2794145,"file_name":"0.png","project_id":160539,"asset_id":233245,"created_at":"2020-06-30T17:39:39.231+08:00","updated_at":"2020-06-30T17:39:39.231+08:00"},{"id":2794146,"file_name":"1.png","project_id":160539,"asset_id":233218,"created_at":"2020-06-30T17:39:39.233+08:00","updated_at":"2020-06-30T17:39:39.233+08:00"},{"id":2794161,"file_name":"can.png","project_id":160539,"asset_id":233350,"created_at":"2020-06-30T17:39:41.016+08:00","updated_at":"2020-06-30T17:39:41.016+08:00"},{"id":2794162,"file_name":"dot.png","project_id":160539,"asset_id":233228,"created_at":"2020-06-30T17:39:41.018+08:00","updated_at":"2020-06-30T17:39:41.018+08:00"},{"id":2794171,"file_name":"p_0.png","project_id":160539,"asset_id":233236,"created_at":"2020-06-30T17:39:42.011+08:00","updated_at":"2020-06-30T17:39:42.011+08:00"},{"id":2794172,"file_name":"p_1.png","project_id":160539,"asset_id":233237,"created_at":"2020-06-30T17:39:42.013+08:00","updated_at":"2020-06-30T17:39:42.013+08:00"},{"id":2794173,"file_name":"p_2.png","project_id":160539,"asset_id":233238,"created_at":"2020-06-30T17:39:42.195+08:00","updated_at":"2020-06-30T17:39:42.195+08:00"},{"id":2794174,"file_name":"p_3.png","project_id":160539,"asset_id":233239,"created_at":"2020-06-30T17:39:42.197+08:00","updated_at":"2020-06-30T17:39:42.197+08:00"},{"id":2794180,"file_name":"6.png","project_id":160539,"asset_id":233222,"created_at":"2020-06-30T17:41:28.236+08:00","updated_at":"2020-06-30T17:41:28.236+08:00"},{"id":2794181,"file_name":"12.png","project_id":160539,"asset_id":233223,"created_at":"2020-06-30T17:41:28.238+08:00","updated_at":"2020-06-30T17:41:28.238+08:00"},{"id":2794184,"file_name":"30.png","project_id":160539,"asset_id":233346,"created_at":"2020-06-30T17:41:28.689+08:00","updated_at":"2020-06-30T17:41:28.689+08:00"},{"id":2794185,"file_name":"36.png","project_id":160539,"asset_id":233226,"created_at":"2020-06-30T17:41:28.691+08:00","updated_at":"2020-06-30T17:41:28.691+08:00"},{"id":2794186,"file_name":"42.png","project_id":160539,"asset_id":233347,"created_at":"2020-06-30T17:41:28.890+08:00","updated_at":"2020-06-30T17:41:28.890+08:00"},{"id":2794187,"file_name":"48.png","project_id":160539,"asset_id":233348,"created_at":"2020-06-30T17:41:28.892+08:00","updated_at":"2020-06-30T17:41:28.892+08:00"},{"id":2794188,"file_name":"6.png","project_id":160539,"asset_id":233222,"created_at":"2020-06-30T17:41:44.003+08:00","updated_at":"2020-06-30T17:41:44.003+08:00"},{"id":2794189,"file_name":"s_1.png","project_id":160539,"asset_id":233355,"created_at":"2020-06-30T17:52:27.383+08:00","updated_at":"2020-06-30T17:52:27.383+08:00"},{"id":2794190,"file_name":"s_2.png","project_id":160539,"asset_id":233356,"created_at":"2020-06-30T17:52:27.385+08:00","updated_at":"2020-06-30T17:52:27.385+08:00"},{"id":2794191,"file_name":"s_3.png","project_id":160539,"asset_id":233357,"created_at":"2020-06-30T17:52:27.588+08:00","updated_at":"2020-06-30T17:52:27.588+08:00"},{"id":2793692,"file_name":"remove.ogg","project_id":160539,"asset_id":233248,"created_at":"2020-06-30T10:45:39.277+08:00","updated_at":"2020-06-30T10:45:39.277+08:00"},{"id":2793693,"file_name":"bgm.mp3","project_id":160539,"asset_id":233249,"created_at":"2020-06-30T10:45:39.404+08:00","updated_at":"2020-06-30T10:45:39.404+08:00"},{"id":2793694,"file_name":"drop.wav","project_id":160539,"asset_id":233250,"created_at":"2020-06-30T10:45:39.413+08:00","updated_at":"2020-06-30T10:45:39.413+08:00"},{"id":2793695,"file_name":"cook.ogg","project_id":160539,"asset_id":233251,"created_at":"2020-06-30T10:45:39.420+08:00","updated_at":"2020-06-30T10:45:39.420+08:00"},{"id":2794192,"file_name":"s_00.png","project_id":160539,"asset_id":233358,"created_at":"2020-06-30T18:07:10.585+08:00","updated_at":"2020-06-30T18:07:29.532+08:00"},{"id":2794147,"file_name":"2.png","project_id":160539,"asset_id":233345,"created_at":"2020-06-30T17:39:39.486+08:00","updated_at":"2020-06-30T17:39:39.486+08:00"},{"id":2794148,"file_name":"3.png","project_id":160539,"asset_id":233219,"created_at":"2020-06-30T17:39:39.488+08:00","updated_at":"2020-06-30T17:39:39.488+08:00"},{"id":2794160,"file_name":"bg.png","project_id":160539,"asset_id":233349,"created_at":"2020-06-30T17:39:40.754+08:00","updated_at":"2020-06-30T17:39:40.754+08:00"},{"id":2794217,"file_name":"info.png","project_id":160539,"asset_id":233359,"created_at":"2020-06-30T18:43:48.209+08:00","updated_at":"2020-06-30T18:43:48.209+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦