MR. SLiK
02-19-2003, 03:49 AM
Alright I REALLY need help on something in C-Sharp. Im making this game for a project in my computer class and I chose to use C-Sharp. Now what I want to do is this: When the user press an arrow key (left, right, etc.) I want it to move a corresponding image on my forum. Now I have event handlers and I already have the basic setup for it. For Example
this.KeyUp += new KeyEventHandler(ArrowKeyLeft);
//When "Start" button is clicked these are the corresponding events
private void start_Click(object sender, System.EventArgs e)
{
void ArrowKeyLeft(object sender, KeyEventArgs key)
{
if(key.KeyCode==Keys.Left)
{
...
Move image left. (Need real code here)
}
}
}
I have looked for tutorials everywhere and i cant seem to find this!
this.KeyUp += new KeyEventHandler(ArrowKeyLeft);
//When "Start" button is clicked these are the corresponding events
private void start_Click(object sender, System.EventArgs e)
{
void ArrowKeyLeft(object sender, KeyEventArgs key)
{
if(key.KeyCode==Keys.Left)
{
...
Move image left. (Need real code here)
}
}
}
I have looked for tutorials everywhere and i cant seem to find this!