I'm making Tetris. The thing is, I've gotten all the hit detections and shit working. Now the next thing to do is to set it to move on a mouse button. Since we are getting ready for a Java AP test, we are not allowed to use any form designers. I've put in this code form Form1_Load:
| Code: |
| this.KeyDown += new System.Windows.Forms.KeyEventHandler(Steering); |
| Code: |
private void Steering(object sender, KeyEventArgs e) { Console.WriteLine("KeyData: " + e.KeyData); Console.WriteLine("KeyCode: " + e.KeyCode); Console.WriteLine("KeyValue: " + e.KeyValue); } |
In the function Steering, on Key Press it's supposed to echo in the console the key data. However, nothing occurs when I press a key. I'm assuming what I'm doing wrong is that the buttons, that act as the tetris blocks, are being active and not the form. Any ideas to fix?
-------
Obvious Troll! Always a right decision!
I'll be here to /halp/ you. Just not emos.