{"id":315102,"student_id":10,"content":"createSprite('e.png');\nlet p1 = createSprite('k_2.png', 'k_1.png', 'k_3.png');\nlet p2 = createSprite('k_2.png', 'k_1.png', 'k_3.png');\nlet p3 = createSprite('k_2.png', 'k_1.png', 'k_3.png');\nlet p4 = createSprite('k_2.png', 'k_1.png', 'k_3.png');\nlet p5 = createSprite('k_2.png', 'k_1.png', 'k_3.png');\nlet p6 = createSprite('k_2.png', 'k_1.png', 'k_3.png');\nlet p7 = createSprite('k_2.png', 'k_1.png', 'k_3.png');\nlet p8 = createSprite('k_2.png', 'k_1.png', 'k_3.png');\nlet board = createSprite('board.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')\nlet n5 = createSprite('0.png', '1.png', '2.png', '3.png', '4.png', '5.png', '6.png', '7.png', '8.png', '9.png')\nlet result = createSprite('result_0.png', 'result_1.png', 'result_2.png')\nlet curtain = createSprite('curtain.png');\n\nresult.moveTo(600, 400);\nn1.moveTo(350, 180);\nn2.moveTo(450, 180);\nn3.moveTo(550, 180);\nn4.moveTo(650, 180);\nn5.moveTo(750, 180);\np8.moveTo(150 * 0 + 75, 700);\np7.moveTo(150 * 1 + 75, 700);\np6.moveTo(150 * 2 + 75, 700);\np5.moveTo(150 * 3 + 75, 700);\np4.moveTo(150 * 4 + 75, 700);\np3.moveTo(150 * 5 + 75, 700);\np2.moveTo(150 * 6 + 75, 700);\np1.moveTo(150 * 7 + 75, 700);\nboard.y = 300;\nboard.scale = 2;\n\nlet clock = 0;\nlet meter = 0;\nlet round = 0;\nlet timer = 0;\nlet beat = 60;\nlet acc = 'best';\nlet score = 0;\nlet combo = 0;\nlet vy = 0;\nlet status = 0;\nlet maxCombo = 0;\nlet normal = 0;\nlet miss = 0;\nlet good = 0;\nlet scoreTar = 0;\n\nfunction gameloop () {\n\n if (status == 1) {\n clock += 1;\n timer -= 1;\n }\n\n if (clock % beat == 10) {\n p1.direction = 90;\n p2.direction = 90;\n p3.direction = 90;\n p4.direction = 90;\n p5.direction = 90;\n p6.direction = 90;\n p7.direction = 90;\n p8.direction = 90;\n }\n\n if (clock % beat == 0 \u0026\u0026 status == 1) {\n meter += 1;\n\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 = beat;\n }\n if (meter == 8) playSound(p8);\n\n if (meter == 8) {\n meter = 0;\n createSound('2.wav');\n\n round++\n if (round % 2 == 0) {\n p1.costumeId = Math.floor(Math.random() * 3);\n p2.costumeId = Math.floor(Math.random() * 3);\n p3.costumeId = Math.floor(Math.random() * 3);\n p4.costumeId = Math.floor(Math.random() * 3);\n p5.costumeId = Math.floor(Math.random() * 3);\n p6.costumeId = Math.floor(Math.random() * 3);\n p7.costumeId = Math.floor(Math.random() * 3);\n }\n\n if (round % 4 == 0) {\n beat = beat / 2;\n }\n\n if (round \u003e= 12) {\n status = 2;\n }\n }\n }\n\n if (status == 1 \u0026\u0026 curtain.y \u003e -450) {\n curtain.y -= 10;\n }\n if (status == 2 \u0026\u0026 curtain.y \u003c 450) {\n curtain.y += 10;\n }\n \n if (scoreTar \u003c score) scoreTar += Math.floor((score - scoreTar) / 10)\n \n n1.costumeId = Math.floor(scoreTar / 10000) % 10;\n n2.costumeId = Math.floor(scoreTar / 1000) % 10;\n n3.costumeId = Math.floor(scoreTar / 100) % 10;\n n4.costumeId = Math.floor(scoreTar / 10) % 10;\n n5.costumeId = Math.floor(scoreTar / 1) % 10;\n // drawText('acc: ' + acc, 10, 10, 'white', 30);\n // drawText('score: ' + score, 10, 40, 'white', 30);\n // drawText('round: ' + round, 10, 70, 'white', 30);\n // drawText('combo: ' + combo, 10, 100, 'white', 30);\n // drawText('clock % beat: ' + clock % beat, 10, 130, 'white', 30);\n}\n\nfunction playSound (sprite) {\n if (sprite.costumeId == 0) createSound('2.wav');\n if (sprite.costumeId == 1) createSound('3.mp3');\n sprite.direction = 120;\n}\n\nfunction hitSpace () {\n playSound(p7);\n timer = Math.abs(timer);\n\n if (timer \u003c 5) {\n result.costumeId = 0;\n acc = '良';\n score += 500;\n combo++;\n } else if (timer \u003c 10) {\n acc = '可';\n result.costumeId = 1;\n score += 250;\n combo++;\n } else {\n acc = '不可';\n result.costumeId = 2;\n combo = 0;\n }\n\n score += combo * 50;\n\n if (status == 0) {\n status = 1;\n createSound('bgm_2.mp3', true);\n }\n}\n\nforever(gameloop);\non('keydown', 'space', hitSpace);","created_at":"2021-11-14T22:04:39.391+08:00","updated_at":"2021-11-29T19:06:33.569+08:00","name":"節奏之王","language":"javascript","screenshot":{"url":"https://cdn6.koding.school/uploads/project/screenshot/315102/2e34eb6f945d4ce142742674c447c20b.jpg"},"parent_id":2,"plugin":"Game.set({width: 1200, height: 900})","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":197,"hashid":"kdms6ezdk","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":6494044,"file_name":"k_3.png","project_id":315102,"asset_id":437606,"created_at":"2021-11-14T22:05:08.963+08:00","updated_at":"2021-11-29T18:44:13.387+08:00"},{"id":6496250,"file_name":"bgm_2.mp3","project_id":315102,"asset_id":438072,"created_at":"2021-11-16T00:16:13.677+08:00","updated_at":"2021-11-16T00:16:13.677+08:00"},{"id":6494042,"file_name":"2.wav","project_id":315102,"asset_id":2255,"created_at":"2021-11-14T22:05:02.766+08:00","updated_at":"2021-11-14T22:05:02.766+08:00"},{"id":6494043,"file_name":"1.wav","project_id":315102,"asset_id":437605,"created_at":"2021-11-14T22:05:02.769+08:00","updated_at":"2021-11-14T22:05:02.769+08:00"},{"id":6494059,"file_name":"bgm.mp3","project_id":315102,"asset_id":437611,"created_at":"2021-11-14T23:26:54.686+08:00","updated_at":"2021-11-14T23:26:54.686+08:00"},{"id":6496348,"file_name":"3.mp3","project_id":315102,"asset_id":438073,"created_at":"2021-11-16T00:35:02.915+08:00","updated_at":"2021-11-16T00:35:02.915+08:00"},{"id":6655060,"file_name":"e.png","project_id":315102,"asset_id":443960,"created_at":"2021-11-29T17:50:07.433+08:00","updated_at":"2021-11-29T17:50:07.433+08:00"},{"id":6655072,"file_name":"3.png","project_id":315102,"asset_id":443968,"created_at":"2021-11-29T18:29:31.069+08:00","updated_at":"2021-11-29T18:29:31.069+08:00"},{"id":6655073,"file_name":"2.png","project_id":315102,"asset_id":443969,"created_at":"2021-11-29T18:29:31.071+08:00","updated_at":"2021-11-29T18:29:31.071+08:00"},{"id":6655029,"file_name":"bg.jpeg","project_id":315102,"asset_id":443959,"created_at":"2021-11-29T17:29:08.184+08:00","updated_at":"2021-11-29T17:29:08.184+08:00"},{"id":6655078,"file_name":"result_2.png","project_id":315102,"asset_id":443974,"created_at":"2021-11-29T18:42:16.493+08:00","updated_at":"2021-11-29T18:42:16.493+08:00"},{"id":6655068,"file_name":"7.png","project_id":315102,"asset_id":443964,"created_at":"2021-11-29T18:29:29.981+08:00","updated_at":"2021-11-29T18:29:29.981+08:00"},{"id":6655069,"file_name":"6.png","project_id":315102,"asset_id":443965,"created_at":"2021-11-29T18:29:29.983+08:00","updated_at":"2021-11-29T18:29:29.983+08:00"},{"id":6655070,"file_name":"5.png","project_id":315102,"asset_id":443966,"created_at":"2021-11-29T18:29:30.525+08:00","updated_at":"2021-11-29T18:29:30.525+08:00"},{"id":6655071,"file_name":"4.png","project_id":315102,"asset_id":443967,"created_at":"2021-11-29T18:29:30.527+08:00","updated_at":"2021-11-29T18:29:30.527+08:00"},{"id":6655065,"file_name":"board.png","project_id":315102,"asset_id":443961,"created_at":"2021-11-29T18:24:58.437+08:00","updated_at":"2021-11-29T18:24:58.437+08:00"},{"id":6494045,"file_name":"k_2.png","project_id":315102,"asset_id":437607,"created_at":"2021-11-14T22:05:08.965+08:00","updated_at":"2021-11-29T18:44:11.154+08:00"},{"id":6655076,"file_name":"result_0.png","project_id":315102,"asset_id":443972,"created_at":"2021-11-29T18:42:15.879+08:00","updated_at":"2021-11-29T18:42:15.879+08:00"},{"id":6655077,"file_name":"result_1.png","project_id":315102,"asset_id":443973,"created_at":"2021-11-29T18:42:15.881+08:00","updated_at":"2021-11-29T18:42:15.881+08:00"},{"id":6655997,"file_name":"curtain.png","project_id":315102,"asset_id":443977,"created_at":"2021-11-29T19:11:09.201+08:00","updated_at":"2021-11-29T19:11:09.201+08:00"},{"id":6655074,"file_name":"1.png","project_id":315102,"asset_id":443970,"created_at":"2021-11-29T18:29:31.620+08:00","updated_at":"2021-11-29T18:29:31.620+08:00"},{"id":6655075,"file_name":"0.png","project_id":315102,"asset_id":443971,"created_at":"2021-11-29T18:29:31.621+08:00","updated_at":"2021-11-29T18:29:31.621+08:00"},{"id":6655066,"file_name":"9.png","project_id":315102,"asset_id":443962,"created_at":"2021-11-29T18:29:29.399+08:00","updated_at":"2021-11-29T18:29:29.399+08:00"},{"id":6655067,"file_name":"8.png","project_id":315102,"asset_id":443963,"created_at":"2021-11-29T18:29:29.401+08:00","updated_at":"2021-11-29T18:29:29.401+08:00"},{"id":6494046,"file_name":"k_1.png","project_id":315102,"asset_id":437608,"created_at":"2021-11-14T22:05:09.586+08:00","updated_at":"2021-11-29T18:44:08.862+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦