{"id":323181,"student_id":10,"content":"setBackdrop('bg.png');\nlet result = createSprite('result_0.png', 'result_1.png', 'result_2.png')\nlet p1 = createSprite('k_0.png', 'k_1.png', 'k_2.png', 'k_3.png', 'k_4.png', 'k_5.png');\nlet p2 = createSprite('k_0.png', 'k_1.png', 'k_2.png', 'k_3.png', 'k_4.png', 'k_5.png');\nlet p3 = createSprite('k_0.png', 'k_1.png', 'k_2.png', 'k_3.png', 'k_4.png', 'k_5.png');\nlet p4 = createSprite('k_0.png', 'k_1.png', 'k_2.png', 'k_3.png', 'k_4.png', 'k_5.png');\nlet p5 = createSprite('k_0.png', 'k_1.png', 'k_2.png', 'k_3.png', 'k_4.png', 'k_5.png');\nlet p6 = createSprite('k_0.png', 'k_1.png', 'k_2.png', 'k_3.png', 'k_4.png', 'k_5.png');\nlet p7 = createSprite('k_0.png', 'k_1.png', 'k_2.png', 'k_3.png', 'k_4.png', 'k_5.png');\nlet n1 = createSprite('0.png', '1.png', '2.png', '3.png', '4.png', '5.png', '6.png', '7.png', '8.png', '9.png');\nlet n2 = createSprite('0.png', '1.png', '2.png', '3.png', '4.png', '5.png', '6.png', '7.png', '8.png', '9.png');\nlet n3 = createSprite('0.png', '1.png', '2.png', '3.png', '4.png', '5.png', '6.png', '7.png', '8.png', '9.png');\nlet n4 = createSprite('0.png', '1.png', '2.png', '3.png', '4.png', '5.png', '6.png', '7.png', '8.png', '9.png');\n\np1.moveTo(150 * 7, 700);\np2.moveTo(150 * 6, 700);\np3.moveTo(150 * 5, 700);\np4.moveTo(150 * 4, 700);\np5.moveTo(150 * 3, 700);\np6.moveTo(150 * 2, 700);\np7.moveTo(150 * 1, 700);\n\nn1.moveTo(450, 430);\nn2.moveTo(550, 430);\nn3.moveTo(650, 430);\nn4.moveTo(750, 430);\nresult.moveTo(600, 300);\n\nlet score = 0;\nlet clock = 0;\nlet meter = 0;\nlet round = 0;\nlet beat = 30;\nlet timer = 0;\n\nfunction gameloop () {\n \n print(clock, 10, 10, 'white', 20);\n print(meter, 10, 30, 'white', 20);\n print(round, 10, 50, 'white', 20);\n\n updateScore();\n\n if (clock == 0) {\n createSound('bgm.mp3', true);\n }\n\n clock += 1;\n\n if (clock % beat == 0) {\n \n meter += 1;\n if (meter == 1) playSound(p1);\n if (meter == 2) playSound(p2);\n if (meter == 3) playSound(p3);\n if (meter == 4) playSound(p4);\n if (meter == 5) playSound(p5);\n if (meter == 6) {\n playSound(p6);\n timer = clock;\n }\n\n if (meter == 8) {\n meter = 0;\n round += 1;\n\n p1.costumeId -= 1;\n p2.costumeId -= 1;\n p3.costumeId -= 1;\n p4.costumeId -= 1;\n p5.costumeId -= 1;\n p6.costumeId -= 1;\n p7.costumeId = 0;\n \n if (round % 2 == 0) {\n p1.costumeId = Math.floor(Math.random() * 3) * 2;\n p2.costumeId = Math.floor(Math.random() * 3) * 2;\n p3.costumeId = Math.floor(Math.random() * 3) * 2;\n p4.costumeId = Math.floor(Math.random() * 3) * 2;\n p5.costumeId = Math.floor(Math.random() * 3) * 2;\n p6.costumeId = Math.floor(Math.random() * 3) * 2;\n p7.costumeId = Math.floor(Math.random() * 3) * 2;\n }\n }\n \n if (round == 2) beat = 60;\n if (round == 4) beat = 30;\n if (round == 6) beat = 15;\n if (round == 7) beat = 120;\n if (round == 8) beat = 60;\n if (round == 10) beat = 30;\n if (round == 12) beat = 15;\n if (round == 13) beat = 120;\n if (round == 14) stop();\n }\n}\n\nfunction playSound (sprite) {\n createSound('drum.wav');\n sprite.costumeId += 1;\n}\n\nfunction press () {\n playSound(p7);\n let diff = Math.abs(clock - timer - beat);\n if (diff \u003c 5) {\n result.costumeId = 0;\n score += 10;\n } else if (diff \u003c 10) {\n result.costumeId = 1;\n score += 5;\n } else {\n result.costumeId = 2;\n }\n}\n\nfunction updateScore () {\n n1.costumeId = Math.floor(score / 1000) % 10;\n n2.costumeId = Math.floor(score / 100) % 10;\n n3.costumeId = Math.floor(score / 10) % 10;\n n4.costumeId = Math.floor(score / 1) % 10;\n}\n\nforever(gameloop);\non('keydown', 'space', press);\n\n","created_at":"2021-12-06T18:04:50.280+08:00","updated_at":"2022-07-20T15:30:19.464+08:00","name":"節奏之王","language":"javascript","screenshot":{"url":"https://cdn3.koding.school/uploads/project/screenshot/323181/5d6a7de6d9950c1fe21aea59ae1e569c.jpg"},"parent_id":2,"plugin":"Game.set({ width: 1200, height: 900 });","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":174,"hashid":"meysw2dpe","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":6749834,"file_name":"k_0.png","project_id":323181,"asset_id":446099,"created_at":"2021-12-06T18:05:33.203+08:00","updated_at":"2021-12-06T18:05:33.203+08:00"},{"id":6749835,"file_name":"5.png","project_id":323181,"asset_id":446100,"created_at":"2021-12-06T18:05:33.205+08:00","updated_at":"2021-12-06T18:05:33.205+08:00"},{"id":6749838,"file_name":"9.png","project_id":323181,"asset_id":446103,"created_at":"2021-12-06T18:05:34.304+08:00","updated_at":"2021-12-06T18:05:34.304+08:00"},{"id":6749839,"file_name":"6.png","project_id":323181,"asset_id":446104,"created_at":"2021-12-06T18:05:34.306+08:00","updated_at":"2021-12-06T18:05:34.306+08:00"},{"id":6749832,"file_name":"result_0.png","project_id":323181,"asset_id":446097,"created_at":"2021-12-06T18:05:32.110+08:00","updated_at":"2021-12-06T18:05:32.110+08:00"},{"id":6749833,"file_name":"result_1.png","project_id":323181,"asset_id":446098,"created_at":"2021-12-06T18:05:32.112+08:00","updated_at":"2021-12-06T18:05:32.112+08:00"},{"id":6749901,"file_name":"bgm.mp3","project_id":323181,"asset_id":438072,"created_at":"2021-12-06T18:52:46.639+08:00","updated_at":"2021-12-06T18:52:46.639+08:00"},{"id":6749844,"file_name":"3.png","project_id":323181,"asset_id":446109,"created_at":"2021-12-06T18:05:37.032+08:00","updated_at":"2021-12-06T18:05:37.032+08:00"},{"id":6749826,"file_name":"8.png","project_id":323181,"asset_id":446091,"created_at":"2021-12-06T18:05:29.059+08:00","updated_at":"2021-12-06T18:05:29.059+08:00"},{"id":6749827,"file_name":"7.png","project_id":323181,"asset_id":446092,"created_at":"2021-12-06T18:05:29.061+08:00","updated_at":"2021-12-06T18:05:29.061+08:00"},{"id":6749840,"file_name":"1.png","project_id":323181,"asset_id":446105,"created_at":"2021-12-06T18:05:34.825+08:00","updated_at":"2021-12-06T18:05:34.825+08:00"},{"id":6749841,"file_name":"2.png","project_id":323181,"asset_id":446106,"created_at":"2021-12-06T18:05:34.827+08:00","updated_at":"2021-12-06T18:05:34.827+08:00"},{"id":6749828,"file_name":"k_4.png","project_id":323181,"asset_id":446093,"created_at":"2021-12-06T18:05:29.651+08:00","updated_at":"2021-12-06T18:05:29.651+08:00"},{"id":6749829,"file_name":"result_2.png","project_id":323181,"asset_id":446094,"created_at":"2021-12-06T18:05:29.652+08:00","updated_at":"2021-12-06T18:05:29.652+08:00"},{"id":6749854,"file_name":"drum.wav","project_id":323181,"asset_id":437605,"created_at":"2021-12-06T18:47:34.105+08:00","updated_at":"2021-12-06T18:47:34.105+08:00"},{"id":6749830,"file_name":"bg.png","project_id":323181,"asset_id":446095,"created_at":"2021-12-06T18:05:31.503+08:00","updated_at":"2021-12-06T18:05:31.503+08:00"},{"id":6749831,"file_name":"k_2.png","project_id":323181,"asset_id":446096,"created_at":"2021-12-06T18:05:31.505+08:00","updated_at":"2021-12-06T18:05:31.505+08:00"},{"id":6749842,"file_name":"4.png","project_id":323181,"asset_id":446107,"created_at":"2021-12-06T18:05:35.923+08:00","updated_at":"2021-12-06T18:05:35.923+08:00"},{"id":6749843,"file_name":"k_1.png","project_id":323181,"asset_id":446108,"created_at":"2021-12-06T18:05:35.924+08:00","updated_at":"2021-12-06T18:05:35.924+08:00"},{"id":6749824,"file_name":"k_6.png","project_id":323181,"asset_id":446089,"created_at":"2021-12-06T18:05:28.002+08:00","updated_at":"2021-12-06T18:05:28.002+08:00"},{"id":6749825,"file_name":"k_3.png","project_id":323181,"asset_id":446090,"created_at":"2021-12-06T18:05:28.003+08:00","updated_at":"2021-12-06T18:05:28.003+08:00"},{"id":6749836,"file_name":"k_5.png","project_id":323181,"asset_id":446101,"created_at":"2021-12-06T18:05:33.762+08:00","updated_at":"2021-12-06T18:05:33.762+08:00"},{"id":6749837,"file_name":"0.png","project_id":323181,"asset_id":446102,"created_at":"2021-12-06T18:05:33.764+08:00","updated_at":"2021-12-06T18:05:33.764+08:00"},{"id":7143269,"file_name":"triangle.mp3","project_id":323181,"asset_id":463374,"created_at":"2022-01-12T15:12:53.286+08:00","updated_at":"2022-01-12T15:12:53.286+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦