diff --git a/ModelingMusic/MusicFrom.cs b/ModelingMusic/MusicFrom.cs index 6b22f47..1dd6991 100644 --- a/ModelingMusic/MusicFrom.cs +++ b/ModelingMusic/MusicFrom.cs @@ -32,7 +32,32 @@ public class MusicFrom { // 随机数 int random = Program.random.Next(0, 7); - DownKey(jianpan[random]); + switch (random) + { + case 0: + DownKey('D', 3); + break; + case 1: + DownKey('F', 10); + break; + case 2: + DownKey('G', 17); + break; + case 3: + DownKey('M', 24); + break; + case 4: + DownKey('J', 31); + break; + case 5: + DownKey('K', 38); + break; + case 6: + DownKey('L', 45); + break; + default: + break; + } Thread.Sleep(1000); } } @@ -41,16 +66,16 @@ public class MusicFrom public char key; public bool isDown;//是否被按下 } - public void DownKey(char key) + public void DownKey(char key, int x) { new Thread(() => { var zIFUKEY = new ZIFUKEY() { key = key, isDown = false }; for (int i = 0; i < MaxY; i++) { - Program.chars[i, 3].Char = zIFUKEY.key; - Thread.Sleep(500); - Program.chars[i, 3].Char = ' '; + Program.chars[i, x].Char = zIFUKEY.key; + Thread.Sleep(260); + Program.chars[i, x].Char = ' '; if (zIFUKEY.isDown) { break;