{"id":335135,"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', 'k_6.png', 'k_7.png');\nlet p2 = createSprite('k_0.png', 'k_1.png', 'k_2.png', 'k_3.png', 'k_4.png', 'k_5.png', 'k_6.png', 'k_7.png');\nlet p3 = createSprite('k_0.png', 'k_1.png', 'k_2.png', 'k_3.png', 'k_4.png', 'k_5.png', 'k_6.png', 'k_7.png');\nlet p4 = createSprite('k_0.png', 'k_1.png', 'k_2.png', 'k_3.png', 'k_4.png', 'k_5.png', 'k_6.png', 'k_7.png');\nlet p5 = createSprite('k_0.png', 'k_1.png', 'k_2.png', 'k_3.png', 'k_4.png', 'k_5.png', 'k_6.png', 'k_7.png');\nlet p6 = createSprite('k_0.png', 'k_1.png', 'k_2.png', 'k_3.png', 'k_4.png', 'k_5.png', 'k_6.png', 'k_7.png');\nlet p7 = createSprite('k_0.png', 'k_1.png', 'k_2.png', 'k_3.png', 'k_4.png', 'k_5.png', 'k_6.png', 'k_7.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 info = createSprite('info.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);\nn1.moveTo(450, 430);\nn2.moveTo(550, 430);\nn3.moveTo(650, 430);\nn4.moveTo(750, 430);\nresult.moveTo(600, 300);\n\nlet clock = 0;\nlet beat = 60;\nlet meter = 0;\nlet score = 0;\nlet round = 0;\nlet timer;\nlet combo = 0;\n\nfunction gameloop () {\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 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 + beat;\n }\n // if (meter == 7) playSound(p7);\n if (meter == 8) {\n p1.costumeId = Math.floor(Math.random() * 4);\n p2.costumeId = Math.floor(Math.random() * 4);\n p3.costumeId = Math.floor(Math.random() * 4);\n p4.costumeId = Math.floor(Math.random() * 4);\n p5.costumeId = Math.floor(Math.random() * 4);\n p6.costumeId = Math.floor(Math.random() * 4);\n p7.costumeId = Math.floor(Math.random() * 3);\n meter = 0;\n round += 1;\n }\n\n if (round == 3) beat = 30;\n if (round == 6) beat = 15;\n if (round == 9) beat = 30;\n if (round == 12) beat = 15;\n if (round == 13) beat = 60;\n if (round == 14) stop();\n }\n\n drawText(clock, 10, 10, 'white', 30);\n drawText(beat, 10, 50, 'white', 30);\n drawText(meter, 10, 90, 'white', 30);\n drawText(timer, 10, 130, 'white', 30);\n drawText(score, 10, 170, 'white', 30);\n}\n\nfunction playSound (sprite) {\n sprite.costumeId += 4;\n if (sprite.costumeId == 4) createSound('drum.wav');\n if (sprite.costumeId == 5) createSound('shaker.mp3');\n if (sprite.costumeId == 6) createSound('triangle.mp3');\n}\n\nfunction press () {\n let diff = Math.abs(clock - timer);\n if (diff \u003c 5) {\n result.costumeId = 0;\n score += 100;\n combo += 1;\n } else if (diff \u003c 10) {\n result.costumeId = 1;\n score += 50;\n combo += 1;\n } else {\n result.costumeId = 2;\n combo = 0;\n }\n score += combo * 30;\n playSound(p7);\n\n if (info.hidden == false) {\n info.hidden = true;\n forever(gameloop);\n p7.costumeId = 0;\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\non('keydown', 'space', press);","created_at":"2022-01-12T14:23:38.158+08:00","updated_at":"2022-01-12T16:22:37.859+08:00","name":"w","language":"javascript","screenshot":{"url":"https://cdn9.koding.school/uploads/project/screenshot/335135/e148034020b034840d05e707660b8996.jpg"},"parent_id":2,"plugin":"Game.set({width: 1200, height: 900})","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":161,"hashid":"ej9s2men4","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":7143322,"file_name":"shaker.mp3","project_id":335135,"asset_id":463375,"created_at":"2022-01-12T15:45:55.758+08:00","updated_at":"2022-01-12T15:45:55.758+08:00"},{"id":7143068,"file_name":"k_4.png","project_id":335135,"asset_id":463368,"created_at":"2022-01-12T14:53:50.043+08:00","updated_at":"2022-01-12T14:53:50.043+08:00"},{"id":7143069,"file_name":"k_5.png","project_id":335135,"asset_id":463370,"created_at":"2022-01-12T14:53:50.045+08:00","updated_at":"2022-01-12T14:53:50.045+08:00"},{"id":7143052,"file_name":"result_1.png","project_id":335135,"asset_id":446098,"created_at":"2022-01-12T14:24:25.004+08:00","updated_at":"2022-01-12T14:24:25.004+08:00"},{"id":7143053,"file_name":"result_2.png","project_id":335135,"asset_id":446094,"created_at":"2022-01-12T14:24:25.005+08:00","updated_at":"2022-01-12T14:24:25.005+08:00"},{"id":7143034,"file_name":"2.png","project_id":335135,"asset_id":446106,"created_at":"2022-01-12T14:24:19.100+08:00","updated_at":"2022-01-12T14:24:19.100+08:00"},{"id":7143035,"file_name":"3.png","project_id":335135,"asset_id":446109,"created_at":"2022-01-12T14:24:19.102+08:00","updated_at":"2022-01-12T14:24:19.102+08:00"},{"id":7143038,"file_name":"6.png","project_id":335135,"asset_id":446104,"created_at":"2022-01-12T14:24:20.180+08:00","updated_at":"2022-01-12T14:24:20.180+08:00"},{"id":7143039,"file_name":"7.png","project_id":335135,"asset_id":446092,"created_at":"2022-01-12T14:24:20.183+08:00","updated_at":"2022-01-12T14:24:20.183+08:00"},{"id":7143036,"file_name":"4.png","project_id":335135,"asset_id":446107,"created_at":"2022-01-12T14:24:19.642+08:00","updated_at":"2022-01-12T14:24:19.642+08:00"},{"id":7143037,"file_name":"5.png","project_id":335135,"asset_id":446100,"created_at":"2022-01-12T14:24:19.644+08:00","updated_at":"2022-01-12T14:24:19.644+08:00"},{"id":7143055,"file_name":"drum.wav","project_id":335135,"asset_id":437605,"created_at":"2022-01-12T14:25:44.216+08:00","updated_at":"2022-01-12T14:25:44.216+08:00"},{"id":7143070,"file_name":"k_6.png","project_id":335135,"asset_id":463372,"created_at":"2022-01-12T14:53:50.639+08:00","updated_at":"2022-01-12T14:53:50.639+08:00"},{"id":7143054,"file_name":"bgm.mp3","project_id":335135,"asset_id":438072,"created_at":"2022-01-12T14:25:43.426+08:00","updated_at":"2022-01-12T14:25:43.426+08:00"},{"id":7143051,"file_name":"result_0.png","project_id":335135,"asset_id":446097,"created_at":"2022-01-12T14:24:24.419+08:00","updated_at":"2022-01-12T14:24:24.419+08:00"},{"id":7143064,"file_name":"k_0.png","project_id":335135,"asset_id":463367,"created_at":"2022-01-12T14:53:48.796+08:00","updated_at":"2022-01-12T14:53:48.796+08:00"},{"id":7143065,"file_name":"k_1.png","project_id":335135,"asset_id":463369,"created_at":"2022-01-12T14:53:48.798+08:00","updated_at":"2022-01-12T14:53:48.798+08:00"},{"id":7143066,"file_name":"k_2.png","project_id":335135,"asset_id":463371,"created_at":"2022-01-12T14:53:49.401+08:00","updated_at":"2022-01-12T14:53:49.401+08:00"},{"id":7143067,"file_name":"k_3.png","project_id":335135,"asset_id":463373,"created_at":"2022-01-12T14:53:49.403+08:00","updated_at":"2022-01-12T14:53:49.403+08:00"},{"id":7143040,"file_name":"8.png","project_id":335135,"asset_id":446091,"created_at":"2022-01-12T14:24:20.744+08:00","updated_at":"2022-01-12T14:24:20.744+08:00"},{"id":7143041,"file_name":"9.png","project_id":335135,"asset_id":446103,"created_at":"2022-01-12T14:24:20.746+08:00","updated_at":"2022-01-12T14:24:20.746+08:00"},{"id":7143042,"file_name":"bg.png","project_id":335135,"asset_id":446095,"created_at":"2022-01-12T14:24:22.007+08:00","updated_at":"2022-01-12T14:24:22.007+08:00"},{"id":7143043,"file_name":"info.png","project_id":335135,"asset_id":463366,"created_at":"2022-01-12T14:24:22.008+08:00","updated_at":"2022-01-12T14:24:22.008+08:00"},{"id":7143340,"file_name":"k_7.png","project_id":335135,"asset_id":463379,"created_at":"2022-01-12T16:17:00.343+08:00","updated_at":"2022-01-12T16:17:00.343+08:00"},{"id":7143032,"file_name":"0.png","project_id":335135,"asset_id":446102,"created_at":"2022-01-12T14:24:18.527+08:00","updated_at":"2022-01-12T14:24:18.527+08:00"},{"id":7143033,"file_name":"1.png","project_id":335135,"asset_id":446105,"created_at":"2022-01-12T14:24:18.529+08:00","updated_at":"2022-01-12T14:24:18.529+08:00"},{"id":7143338,"file_name":"triangle.mp3","project_id":335135,"asset_id":463377,"created_at":"2022-01-12T16:10:26.826+08:00","updated_at":"2022-01-12T16:10:26.826+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦