Sooo im doin this project for school and im super stuck on the keydown command, i dont know how to get it to work at all! my teacher is also has learned c# but forgot alot of it.
so basically i want it so that if i press the up arrow the car moves up. i have also googled the s*** out of it and none of it makes sense to me... PLEASE HELP!!!
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
int carX = 230;
int carY = 230;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void carMovement_Tick(object sender, EventArgs e)
{
if (KeyDown += Keys.Up)
{
carY--;
this.carImage.Location = new Point(carX, carY);
if (carY == 0)
{
carY = 0;
}
}
}
}
}