In this episode, I am going to attempt to make my character move by the arrow keys.  Just left and right.
First, I need to set up the bitmap that will hold the character

		Bitmap playerbmp;  // This will hold the main character graphics.
		// Actually, it is a bunch of frames of the character.
playerbmp is the bitmap of the player. It has 10 frames each 16x32 and they are arranged 10x1, so the bitmap is 160x32. You can get the bitmap that I am using here. First, I want to declare some constants that define the size of the character in the bitmap. thecharwidth Width of character on the form and in the bitmap file. It is 16. thecharheight Height of character on form/bitmap. Currently 32. I wanted them to be unequal so that I can make sure that my code will work for all cases.
		const int thecharwidth = 16;
		const int thecharheight = 32;
		// These define the width of the character in the file.
All of those go into the declarations section. Next, I actually need to get the image that goes into the bitmap.
			playerbmp = new Bitmap(Application.StartupPath + @"\..\..\sumult.bmp");
			// Loads the image into this bitmap.
			// Given this arrangement, the bitmap must be in the same directory as the solution.
			playerbmp.MakeTransparent(Color.Magenta);
			// Makes all of the magenta in the bitmap transparent.
Notice the Application.StartupPath... that's the location of the EXE file, which is usually located in the debug folder of the bin folder from the solution. Therefore, the \..\.. takes you up to the folder with the solution in it, and the \sumult.bmp gets the bitmap in the folder (I hope you put the bitmap in the same folder with the solution.) The .MakeTransparent simply makes magenta transparent so that you can see the background instead of magenta. Now, to display the bitmap to the form, I need to draw it in the clock_Tick event.
				gfx.DrawImage(playerbmp, 100, thelandheight - thecharheight, new Rectangle(0, 0, thecharwidth, thecharheight), GraphicsUnit.Pixel);
				// This draws the character to the display.  Right now, the 100 is a fixed number, but When the character moves
				// it'll be changed.
In effect, the 100 will change into the X variable that determines my character's XLocation... also, when I get to animate the character (next episode), the parameters to the rectangle will change. When I turn the character, it will change also, and that's coming up soon. This 12th overload the DrawImage takes the bitmap, the x and y of the drawing location, and a source rectangle that determines what portion of the original image to draw. At this point, the character's first frame should be drawn to the form, touching the grass at the bottom.
Now, to make the character respond to movements. First, I need to make some additions. playerloc is going to hold the X and Y locations for my character. I wanted a rectangle because eventually I will need to see the width and height of the character, mainly for detecting collisions. goleft is true when the Left button is pressed. goright is true when the Right button is pressed. Those two booleans will be check and responder themovespeed - how much the character moves when the clock.
		Rectangle playerloc;
		// This will hold the current location of the player.  X and Y included.
		// Why didn't I use Point?  Because I am probably going to use the height and width for collisions later.
		bool goleft, goright;
		// Indicates if the left or right buttons are pressed.

		const int themovespeed = 5;
		// How much I move every tick.
Now I need to initialize the location of the character. In PFMain_Load:
			playerloc = new Rectangle(100, thelandheight - thecharheight, thecharwidth, thecharheight);
			// Instantiate the player location.
Now, in order to move the character, I don't have to do something like: X += themovespeed I will utilize the Rectangles .Offset method. But more on that when I get there. First, let's set the Booleans in the KeyDown and KeyUp events. The handlers:
			this.KeyDown += new KeyEventHandler(PFMain_KeyDown);
			this.KeyUp +=new KeyEventHandler(PFMain_KeyUp);

		private void PFMain_KeyDown(object sender, KeyEventArgs e)
		{
			if (e.KeyCode == Keys.Left) 
			{
				goleft = true;
			} 
			else if (e.KeyCode == Keys.Right) 
			{
				goright = true;
			}
		}
		private void PFMain_KeyUp(object sender, KeyEventArgs e)
		{
			if (e.KeyCode == Keys.Left) 
			{
				goleft = false;
			} 
			else if (e.KeyCode == Keys.Right) 
			{
				goright = false;
			}
		}
Notice that the keydown and keyup events can only take one key event at a time and then, they fire somewhat sporadically. Doing them like this makes them nice and orderly, and their state can be identified by the booleans. Now, for the Timer.
			if (goleft) 
			{
				playerloc.Offset(-themovespeed, 0);
				// Move player left.
				updateartwork = true;
			} 
			else if (goright) 
			{
				playerloc.Offset(themovespeed, 0);
				// Move player right.
				updateartwork = true; 
			}
That goes before the if updateartwork {} block, as you will want to be able to move the character at all times, not when you need to update the display. Also, the drawImage in the if updateartwork {} block needs to be modified as well:
				gfx.DrawImage(playerbmp, playerloc.X, playerloc.Y , new Rectangle(0, 0, thecharwidth, thecharheight), GraphicsUnit.Pixel);
				// This draws the character to the display based on the current location.
Replace the old gfx.DrawImage in the timer with this. Now, at this point, the image should be moving left and right according to the keys that you press (and hold down).
Now, how to make the character actually face the direction that he is going? We'll just have to add another variable.
		int chardirec;
		// Which direction is the character facing?
chardirec will be 0 if the character is facing left and 1 when he is facing right. Now, to make that happen, I fix it in the Timer subroutine. I don't want to put it in the keydown because the keys can be released out of order.... If you press both keys at once, then the direction will default to 0... based on this modification of the keycode check in the Clock.
			if (goleft) 
			{
				playerloc.Offset(-themovespeed, 0);
				// Move player left.
				updateartwork = true;
				chardirec = 0;  // Look left.
			} 
			else if (goright) 
			{
				playerloc.Offset(themovespeed, 0);
				// Move player right.
				updateartwork = true; 
				chardirec = 1;  // Look right.
			}
Now, I change the DrawImage to this so that the Left property of our source rectangle goes to 4 * CHARWIDTH, the location of the character facing to the right. I can do this with a bitshift.
				gfx.DrawImage(playerbmp, playerloc.X, playerloc.Y , new Rectangle(thecharwidth * (chardirec << 2), 0, thecharwidth, thecharheight), GraphicsUnit.Pixel);
				// This draws the character to the display based on the current location.
Equivalent to:
				gfx.DrawImage(playerbmp, playerloc.X, playerloc.Y , new Rectangle(thecharwidth * (chardirec * 4), 0, thecharwidth, thecharheight), GraphicsUnit.Pixel);
				// This draws the character to the display based on the current location.
And, after you make those few changes, the character should now turn depending on which direction he is going. That concludes this episode... next time, I will attempt to make the character animate.