{"id":696723,"student_id":10,"content":"Game.set({ width: 1600, height: 900 })\nwindow.dispatchEvent(new Event('resize'));\n\nsetBackdrop(\"bg.png\");\n\nlet info = createSprite('start.png', 'success.png', 'gameover.png')\ninfo.layer = 2\n\nlet box = createSprite('box.png')\nbox.moveTo(1300, 500)\n\nlet bgm = createSound('bgm.mp3', true);\nbgm.setVolume(0.3)\n\n// // status\n// // 0: 沒有卡\n// // 1: 有卡\n// // 2: 坐在等待區\n// // 3: 坐在服務區\n// // 4: 成功\n// // 5: 失敗\n\nlet QA = [\n { q: '我想要辦理跨行轉帳,將部分\\n的台幣存款轉移到另一家銀行\\n的帳戶上。', a: 1 },\n { q: '我要提領五萬台幣,準備在過\\n過年發放紅包。', a: 1 },\n { q: '我想開立一個新的台幣存款帳\\n戶。', a: 1 },\n { q: '我想要詢問台幣定期存款的利\\n率和存款期限。', a: 1 },\n { q: '我想要辦理一筆台幣自動轉帳\\n服務,將每月固定金額轉入另\\n一個帳戶。', a: 1 },\n \n { q: '我的薪資收入是以美元支付,\\n我想開立一個美元帳戶。', a: 2 },\n { q: '我想要將手上的歐元存款轉換\\n成台幣。', a: 2 },\n { q: '我打算前往日本旅遊,需要換\\n取一些日圓以應付旅遊開支。', a: 2 },\n { q: '我的外幣存款需要進行定期存\\n款,想詢問有哪些選擇以及利\\n率。', a: 2 },\n { q: '我想要將一筆外幣款項轉帳至\\n我的朋友帳戶。', a: 2 },\n \n { q: '我想要購買一份儲蓄險或投資\\n型保險,想知道銀行有哪些選\\n擇?', a: 3 },\n { q: '我想要購買債券作為投資,想\\n詢問銀行有哪些選擇?', a: 3 },\n { q: '我的投資組合需要進行調整,\\n我想與銀行理財專員討論。', a: 3 },\n { q: '我想要了解銀行提供的理財服\\n務,包括資產配置及建議。', a: 3 },\n { q: '我打算開始投資,想了解銀行\\n提供的基金和ETF產品。', a: 3 },\n \n { q: '我的貸款還款日期即將到期,\\n我想詢問辦理續貸手續。', a: 4 },\n { q: '最近購買了一棟房子,我想申\\n請房屋貸款。', a: 4 },\n { q: '我想詢問貸款的利率與還款期\\n限。', a: 4 },\n { q: '我的信用記錄不佳但我急需資\\n金,想知道是否有提供特殊條\\n件的貸款方案?', a: 4 },\n { q: '我想要申請一筆個人貸款以應\\n付突發的支出。', a: 4 },\n]\n\nlet focus = undefined\nlet images = []\nlet seats = []\nlet services = []\nlet guests = []\nlet clock = 0\nlet speed = 360\nlet failed = 0\nlet score = 0\n\nfor (let i = 0; i \u003c 9; i++) {\n images.push(`g_${i}.png`)\n}\nimages.push(`g_10.png`)\n\nfor (let i = 0; i \u003c 6; i++) {\n let c = createSprite(\"chair.png\")\n c.x = 200 + i * 130\n c.y = 200\n c.on('click', chairOnClick)\n seats.push(c)\n}\n\nfor (let i = 0; i \u003c 5; i++) {\n let t = createSprite(\"table.png\")\n t.moveTo(i * 210, 670)\n}\n\nfor (let i = 0; i \u003c 4; i++) {\n let s = createSprite(`service_${i}.png`)\n s.idx = i\n s.moveTo(i * 210 + 210, 670)\n s.on('click', serviceOnClick)\n services.push(s)\n \n let colors = createSprite('c_0.png', 'c_1.png', 'c_2.png')\n colors.moveTo(s)\n colors.x += 100\n \n let cur = createSprite('cusor.png')\n cur.moveTo(s)\n cur.x += 100\n \n cur.on('click', () =\u003e serviceOnClick.call(s))\n \n s.colors = colors\n}\n\n\nlet btn0 = createSprite('btn_0.png')\nlet btn1 = createSprite('btn_1.png')\nlet btn2 = createSprite('btn_2.png')\nlet btn3 = createSprite('btn_3.png')\nbtn0.moveTo(1200, 550)\nbtn1.moveTo(1400, 550)\nbtn2.moveTo(1200, 610)\nbtn3.moveTo(1400, 610)\nbtn0.on('click', () =\u003e setType(1))\nbtn1.on('click', () =\u003e setType(2))\nbtn2.on('click', () =\u003e setType(3))\nbtn3.on('click', () =\u003e setType(4))\n\nlet btns = [btn0, btn1, btn2, btn3]\n\ninfo.on('click', infoClick)\n\nfunction infoClick() {\n if (info.costumeId === 0) {\n createGuest();\n forever(loop);\n info.hidden = true;\n } else {\n stop()\n window.top.postMessage({ event: 'SET_SCORE', data: { score: score * 10 } }, '*');\n }\n}\n\nfunction setType(answer) {\n if (focus \u0026\u0026 focus.status === 0) {\n if (focus.question.a === answer) {\n focus.costumeId = answer\n focus.status = 1\n createSound('correct.mp3')\n } else {\n focus.costumeId = 9\n focus.status = 5\n createSound('wrong.mp3')\n failed += 1\n }\n focus = undefined\n }\n}\n\nfunction loop() {\n \n clock += 1\n \n if (info.y \u003c 450) {\n info.y += 30\n }\n\n let line = guests.filter(p =\u003e !p.seat)\n line.forEach(g =\u003e {\n index = line.indexOf(g)\n g.moveTo(1200 + 50 * index, 200)\n })\n \n if (clock % speed == 0 \u0026\u0026 line.length \u003c= 6) {\n createGuest()\n }\n \n guests.filter(g =\u003e g.seat).forEach(g =\u003e {\n g.moveTo(g.seat)\n })\n \n services.forEach(s =\u003e {\n if (s.scale \u003c 1) s.scale += 0.1\n s.colors.scale = s.scale\n })\n\n if (focus \u0026\u0026 focus.status === 0) {\n let { q } = focus.question\n q.split('\\n').forEach((line, idx) =\u003e {\n drawText(line, 1100, 370 + idx * 40, 'black', 30) \n })\n \n }\n\n if (focus \u0026\u0026 (focus.status === 1 || focus.status === 2)) {\n focus.moveTo(cursor)\n }\n \n btns.forEach(btn =\u003e {\n btn.scale = 1\n if (btn.touched(cursor)) {\n btn.scale = 1.05\n if (cursor.isDown) btn.scale = 0.9\n }\n })\n \n guests = guests.filter(g =\u003e g.status \u003c= 3)\n\n let timer = 120 - Math.floor(clock / 60)\n if (timer === 0 || failed === 3) {\n gameover()\n }\n \n if (info.costumeId === 0) {\n drawText(timer, 1100, 810, 'black', 40)\n drawText(failed, 1300, 810, 'black', 40) \n }\n \n}\n\nfunction createGuest() {\n let g = createSprite(images)\n g.value = 10\n g.engry = 0\n g.status = 0\n g.moveTo(-1000, -1000)\n g.rotationStyle = 'flipped'\n g.question = QA[Math.floor(Math.random() * QA.length)]\n g.on('click', guestOnClick)\n g.forever(guestLoop)\n guests.push(g)\n}\n\nfunction guestOnClick() {\n setTimeout(() =\u003e {\n focus = focus === this ? undefined : this \n })\n}\n\nfunction guestLoop() {\n\n if (this.status === 4 || this.status === 5) {\n this.layer = 100\n this.scale = 1\n this.costumeId = this.status === 4 ? 0 : 9\n this.x += this.status === 4 ? 20 : -20\n this.y += Math.random() * 30 - 15\n if (this.x \u003c 0 || this.x \u003e 1600) this.destroy()\n return\n }\n\n if (this.engry \u003c= 50 \u0026\u0026 clock % 60 === 0) {\n this.engry += 1\n if (this.costumeId \u003c= 4) {\n this.engry += 1\n }\n if (this.engry \u003e= 50) {\n this.status = 5\n createSound('wrong.mp3')\n this.direction = 270 + Math.random() * 60 - 30\n failed += 1\n }\n }\n \n if (info.costumeId === 0) {\n pen.size = 10\n pen.color = this.engry \u003e 35 ? 'red' : 'black'\n pen.drawLine(this.x - 25, this.y - 150, this.x - 25 + this.engry, this.y - 150) \n }\n \n}\n\n\nfunction chairOnClick() {\n if (focus \u0026\u0026 focus.status === 1) {\n let tmp = focus\n setTimeout(() =\u003e {\n let empty = !guests.some(g =\u003e g.seat === this)\n if (empty) {\n tmp.engry = 0\n tmp.seat = undefined\n tmp.costumeId += 4\n tmp.status = 2\n tmp.seat = this\n }\n });\n }\n}\n\nfunction serviceOnClick() {\n let guest = guests.find(g =\u003e g.seat === this)\n \n if (focus \u0026\u0026 focus.status === 2) {\n let tmp = focus\n setTimeout(() =\u003e {\n let empty = !guests.some(g =\u003e g.seat === this)\n if (!empty) return\n tmp.seat = this\n tmp.layer = -1\n tmp.scale = 1.5\n if (tmp.question.a === this.idx + 1) {\n tmp.status = 3\n } else {\n tmp.status = 5\n failed += 1\n createSound('wrong.mp3')\n }\n });\n } else {\n let guest = guests.find(g =\u003e g.seat === this)\n if (guest) {\n guest.value -= 1\n this.scale = 0.8\n \n if (guest.value \u003c= 1) this.colors.costumeId = 0\n else if (guest.value \u003c= 6) this.colors.costumeId = 1\n else this.colors.costumeId = 2\n \n createSound('keyboard.ogg')\n if (guest.value \u003c= 0) {\n guest.status = 4\n createSound('correct.mp3')\n score += 1\n }\n }\n }\n}\n\nfunction gameover() {\n if (info.costumeId === 0) {\n info.costumeId = failed === 3 ? 2 : 1\n info.y = -900\n info.hidden = false\n bgm.pause()\n }\n}\n\n","created_at":"2024-02-19T17:41:12.941+08:00","updated_at":"2024-03-07T16:03:05.648+08:00","name":"銀行業務遊戲","language":"javascript","screenshot":{"url":"https://cdn9.koding.school/uploads/project/screenshot/696723/935aa81e1ad5b484e8c6f35829f6667e.jpg"},"parent_id":2,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":64,"hashid":"gk4snr8ej","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":15601823,"file_name":"g_3.png","project_id":696723,"asset_id":721800,"created_at":"2024-02-19T17:41:32.114+08:00","updated_at":"2024-02-19T17:41:32.114+08:00"},{"id":15601824,"file_name":"g_4.png","project_id":696723,"asset_id":721801,"created_at":"2024-02-19T17:41:32.116+08:00","updated_at":"2024-02-19T17:41:32.116+08:00"},{"id":15601813,"file_name":"btn_2.png","project_id":696723,"asset_id":721790,"created_at":"2024-02-19T17:41:29.841+08:00","updated_at":"2024-02-19T17:41:29.841+08:00"},{"id":15601814,"file_name":"btn_3.png","project_id":696723,"asset_id":721791,"created_at":"2024-02-19T17:41:29.843+08:00","updated_at":"2024-02-19T17:41:29.843+08:00"},{"id":15601821,"file_name":"g_1.png","project_id":696723,"asset_id":721798,"created_at":"2024-02-19T17:41:31.662+08:00","updated_at":"2024-02-19T17:41:31.662+08:00"},{"id":15601822,"file_name":"g_2.png","project_id":696723,"asset_id":721799,"created_at":"2024-02-19T17:41:31.665+08:00","updated_at":"2024-02-19T17:41:31.665+08:00"},{"id":15601825,"file_name":"g_5.png","project_id":696723,"asset_id":721802,"created_at":"2024-02-19T17:41:32.581+08:00","updated_at":"2024-02-19T17:41:32.581+08:00"},{"id":15601826,"file_name":"g_6.png","project_id":696723,"asset_id":721803,"created_at":"2024-02-19T17:41:32.583+08:00","updated_at":"2024-02-19T17:41:32.583+08:00"},{"id":15601819,"file_name":"cusor.png","project_id":696723,"asset_id":721796,"created_at":"2024-02-19T17:41:31.225+08:00","updated_at":"2024-02-19T17:41:31.225+08:00"},{"id":15601820,"file_name":"g_0.png","project_id":696723,"asset_id":721797,"created_at":"2024-02-19T17:41:31.227+08:00","updated_at":"2024-02-19T17:41:31.227+08:00"},{"id":15601827,"file_name":"g_7.png","project_id":696723,"asset_id":721804,"created_at":"2024-02-19T17:41:33.039+08:00","updated_at":"2024-02-19T17:41:33.039+08:00"},{"id":15601828,"file_name":"g_8.png","project_id":696723,"asset_id":721805,"created_at":"2024-02-19T17:41:33.041+08:00","updated_at":"2024-02-19T17:41:33.041+08:00"},{"id":15601817,"file_name":"c_2.png","project_id":696723,"asset_id":721794,"created_at":"2024-02-19T17:41:30.796+08:00","updated_at":"2024-02-19T17:41:30.796+08:00"},{"id":15601818,"file_name":"chair.png","project_id":696723,"asset_id":721795,"created_at":"2024-02-19T17:41:30.798+08:00","updated_at":"2024-02-19T17:41:30.798+08:00"},{"id":15601830,"file_name":"service_0.png","project_id":696723,"asset_id":721807,"created_at":"2024-02-19T17:41:33.647+08:00","updated_at":"2024-02-19T17:41:33.647+08:00"},{"id":15601815,"file_name":"c_0.png","project_id":696723,"asset_id":721792,"created_at":"2024-02-19T17:41:30.289+08:00","updated_at":"2024-02-19T17:41:30.289+08:00"},{"id":15601816,"file_name":"c_1.png","project_id":696723,"asset_id":721793,"created_at":"2024-02-19T17:41:30.291+08:00","updated_at":"2024-02-19T17:41:30.291+08:00"},{"id":15601835,"file_name":"bg.png","project_id":696723,"asset_id":721812,"created_at":"2024-02-19T17:43:08.424+08:00","updated_at":"2024-02-19T17:43:08.424+08:00"},{"id":15601811,"file_name":"btn_0.png","project_id":696723,"asset_id":721788,"created_at":"2024-02-19T17:41:29.420+08:00","updated_at":"2024-02-19T17:41:29.420+08:00"},{"id":15601812,"file_name":"btn_1.png","project_id":696723,"asset_id":721789,"created_at":"2024-02-19T17:41:29.422+08:00","updated_at":"2024-02-19T17:41:29.422+08:00"},{"id":15601831,"file_name":"service_1.png","project_id":696723,"asset_id":721808,"created_at":"2024-02-19T17:41:34.267+08:00","updated_at":"2024-02-19T17:41:34.267+08:00"},{"id":15601832,"file_name":"service_2.png","project_id":696723,"asset_id":721809,"created_at":"2024-02-19T17:41:34.269+08:00","updated_at":"2024-02-19T17:41:34.269+08:00"},{"id":15601833,"file_name":"service_3.png","project_id":696723,"asset_id":721810,"created_at":"2024-02-19T17:41:35.030+08:00","updated_at":"2024-02-19T17:41:35.030+08:00"},{"id":15601834,"file_name":"table.png","project_id":696723,"asset_id":721811,"created_at":"2024-02-19T17:41:35.032+08:00","updated_at":"2024-02-19T17:41:35.032+08:00"},{"id":15614554,"file_name":"g_10.png","project_id":696723,"asset_id":722363,"created_at":"2024-02-23T18:32:13.994+08:00","updated_at":"2024-02-23T18:32:26.423+08:00"},{"id":15614529,"file_name":"box.png","project_id":696723,"asset_id":722362,"created_at":"2024-02-23T17:15:41.875+08:00","updated_at":"2024-02-23T17:15:47.409+08:00"},{"id":15702235,"file_name":"bgm.mp3","project_id":696723,"asset_id":723470,"created_at":"2024-02-26T16:04:35.163+08:00","updated_at":"2024-02-26T16:04:35.163+08:00"},{"id":15702239,"file_name":"keyboard.ogg","project_id":696723,"asset_id":723476,"created_at":"2024-02-26T16:12:42.989+08:00","updated_at":"2024-02-26T16:12:42.989+08:00"},{"id":15702240,"file_name":"c_0.png","project_id":696723,"asset_id":721792,"created_at":"2024-02-26T16:24:06.515+08:00","updated_at":"2024-02-26T16:24:06.515+08:00"},{"id":15702241,"file_name":"c_1.png","project_id":696723,"asset_id":721793,"created_at":"2024-02-26T16:24:06.517+08:00","updated_at":"2024-02-26T16:24:06.517+08:00"},{"id":15702242,"file_name":"c_2.png","project_id":696723,"asset_id":721794,"created_at":"2024-02-26T16:24:06.905+08:00","updated_at":"2024-02-26T16:24:06.905+08:00"},{"id":15702243,"file_name":"cusor.png","project_id":696723,"asset_id":721796,"created_at":"2024-02-26T16:24:06.907+08:00","updated_at":"2024-02-26T16:24:06.907+08:00"},{"id":15702236,"file_name":"error.ogg","project_id":696723,"asset_id":723472,"created_at":"2024-02-26T16:04:56.190+08:00","updated_at":"2024-02-26T16:04:56.190+08:00"},{"id":15705779,"file_name":"gameover.png","project_id":696723,"asset_id":723651,"created_at":"2024-02-27T17:37:54.856+08:00","updated_at":"2024-02-27T17:37:54.856+08:00"},{"id":15705780,"file_name":"start.png","project_id":696723,"asset_id":723652,"created_at":"2024-02-27T17:37:54.857+08:00","updated_at":"2024-02-27T17:37:54.857+08:00"},{"id":15705781,"file_name":"success.png","project_id":696723,"asset_id":723653,"created_at":"2024-02-27T17:37:55.243+08:00","updated_at":"2024-02-27T17:37:55.243+08:00"},{"id":15702237,"file_name":"correct.mp3","project_id":696723,"asset_id":723474,"created_at":"2024-02-26T16:10:44.827+08:00","updated_at":"2024-02-26T16:10:44.827+08:00"},{"id":15702238,"file_name":"wrong.mp3","project_id":696723,"asset_id":723475,"created_at":"2024-02-26T16:10:44.829+08:00","updated_at":"2024-02-26T16:10:44.829+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦