Now, we're going to add multiple coins and walls to the game, to give it some kind of completeness.
First, we'll add support for multiple coins.  Of course, we need some kind of list of coins.  We can use another
arraylist for the coins, and use a For loop or a For Each loop to check all of the coins.

		ArrayList coins;
		// Holds the list of coins for this level.
coins as the arraylist will hold the coins. Coins will be added to it as initialization, and removed while the player collects them. Now, instead of setting the single coin in the Form's Load event procedure (shown below):
			coin = new Rectangle(200, 550, thecoinsize, thecoinsize);
We can add the new coin rectangles to the coins arraylist.
			coins = new ArrayList(100);

			coins.Add(new Rectangle(200, 530, thecoinsize, thecoinsize));
			coins.Add(new Rectangle(100, 440, thecoinsize, thecoinsize));
			coins.Add(new Rectangle(116, 440, thecoinsize, thecoinsize));
			coins.Add(new Rectangle(132, 440, thecoinsize, thecoinsize));
			coins.Add(new Rectangle(260, 355, thecoinsize, thecoinsize));
			coins.Add(new Rectangle(230, 365, thecoinsize, thecoinsize));
			coins.Add(new Rectangle(240, 510, thecoinsize, thecoinsize));
			coins.Add(new Rectangle(20, 490, thecoinsize, thecoinsize));
			coins.Add(new Rectangle(280, 400, thecoinsize, thecoinsize));
			coins.Add(new Rectangle(200, 498, thecoinsize, thecoinsize));
			// Ten coins going into the coins arraylist.
Remember that we could use a point for the coin. We're only using a rectangle so that we can use collision detection with the .IntersectsWith rectangle method. Right now, we have to put all of the coin positions in manually, but eventually, we'll be able to do that from a file. Now, we need to make the character interact with the coins. Probably by now, you realize the main scheme behind adding support for another feature: Ω Create the declarations for it. Ω Instantiate it. Ω Allow the player to interact with it. Ω Draw it. Now, the player interacts with the coins whenever he moves, which is in the CharacterMovement sub. So this:
			if (coin.IntersectsWith(playerloc)) 
			{
				coin = Rectangle.Empty;
				// set this coin to be an empty rectangle
			}
Becomes this:
			for (lv = 0; lv < coins.Count; lv++) 
			{
				coin = (Rectangle)coins[lv];
				if (coin.IntersectsWith(playerloc)) 
				{
					coin = Rectangle.Empty;
					// set this coin to be an empty rectangle
					coins[lv] = coin;
				}
			}
Notice that since the coin is a structure and not a class reference, the newly updated coin has to be reassigned to the coins arraylist. Now, the coins need to be drawn onto the form (which is in the Artwork sub). This:
			if (!coin.IsEmpty) 
			{
				gfx.DrawImage(coinbmp, coin.X, coin.Y, new Rectangle((anim % thecoinframecount) * thecoinsize, 0, thecoinsize, thecoinsize), GraphicsUnit.Pixel);
				// Draw the coin.  Since anim increases, the coin will animation because of the mod and multiply for the left argument.
			}>
Becomes this:
			foreach (Rectangle coin in coins) 
			{
				if (!coin.IsEmpty) 
				{
					gfx.DrawImage(coinbmp, coin.X, coin.Y, new Rectangle((anim % thecoinframecount) * thecoinsize, 0, thecoinsize, thecoinsize), GraphicsUnit.Pixel);
					// Draw the coin.  Since anim increases, the coin will animation because of the mod and multiply for the left argument.
				}
			}  // foreach coin in the arraylist.
And that should add lots of collectible coins on the form.
				if (!isjumping) //Cannot jump if already jumping.
				{
					isjumping = true;
					// The jump is initialized.
					if (godown) 
					{
						playerveloc = PFMain.thelowjumpvelocity;
						// Low jump made when down key is pressed.
					} 
					else 
					{
						playerveloc = PFMain.thesbarinitialvelocity;
						// Use space bar initial velocity.
					}
				}
That's the way to fix the double jumping bug that I just discovered, by adding the if(!isjumping) block in the Keydown event handler. Also, don't forget that you can speed up the whole game by setting the timer interval to ~50.
Now, we do the same thing we did for coins with the walls. Declarations:
		ArrayList walls;
		// The walls for this level.
Instantiation, replace:
			wall = Rectangle.FromLTRB(225, 415, 275, 465);
			// Initialize the wall coordinates.
with:
			walls = new ArrayList(100);
			// The list of walls is set up.
			walls.Add(Rectangle.FromLTRB(225, 415, 275, 465));
			walls.Add(Rectangle.FromLTRB(320, 480, 350, thelandheight));
			walls.Add(Rectangle.FromLTRB(350, 520, 380, thelandheight));
			// And three walls are added.
Allow interaction, by replacing:
				} else if (playerloc.IntersectsWith(wall)) {
					if (playerveloc > 0 ) 
					{
						// player is falling and should land on the wall.
						isjumping = false;
						leftend = wall.Left; rightend = wall.Right;
						// Set the end points for the wall.
						animcycler = 0;
						playerloc.Offset(0, wall.Top - playerloc.Bottom);
					} 
					else 
					{
						// The player is moving upwards and should hit head against wall.
						playerloc.Offset(0, wall.Bottom - playerloc.Top);
						// Move the player so that his head touches the top of the wall.
						playerveloc = 0;
					}
				} else {
with the same thing, except with the foreach loop injected in and a few elses moved around:
				} else {
					foreach (Rectangle wall in walls) 
					{
						if (playerloc.IntersectsWith(wall)) 
						{
							if (playerveloc > 0 ) 
							{
								// player is falling and should land on the wall.
								isjumping = false;
								leftend = wall.Left; rightend = wall.Right;
								// Set the end points for the wall.
								animcycler = 0;
								playerloc.Offset(0, wall.Top - playerloc.Bottom);
							} 
							else 
							{
								// The player is moving upwards and should hit head against wall.
								playerloc.Offset(0, wall.Bottom - playerloc.Top);
								// Move the player so that his head touches the top of the wall.
								playerveloc = 0;
							}
						}
					}
Also, don't forget the left and right collisions need to be fixed as well, and since they are in an else if block, the else if block needs to be altered.
				else 
				{
					foreach (Rectangle wall in walls) 
					{
						if (playerloc.IntersectsWith(wall)) 
						{
							playerloc.Offset(wall.Left - playerloc.Right, 0);
							// Move player back to left edge of wall.
						}
					}
					if (playerloc.Left > rightend && !isjumping ) 
					{
						isjumping = true;
						playerveloc = 0;
						// Falling from edge of platform.
					}
				}
Remember to make the similar change in the GoRight if block.
				} else {
					foreach (Rectangle wall in walls) 
					{
						if (playerloc.IntersectsWith(wall)) 
						{
							playerloc.Offset(wall.Right - playerloc.Left, 0);
							// Move the player back to the right edge of this wall.
						}
					}
					if (playerloc.Right < leftend && !isjumping ) 
					{
						isjumping = true;
						// Falling off the edge of a platform.
						playerveloc = 0;
						// Free-fall.
					}
				}
And then, for displaying all of the walls, replace:
			gfx.FillRectangle(Brushes.Peru, wall);
			gfx.DrawRectangle(Pens.SaddleBrown, wall);
			// Draws the wall onto the form with peruvian interior and saddlebrown border.
With:
			foreach (Rectangle wall in walls) 
			{
				gfx.FillRectangle(Brushes.Peru, wall);
				gfx.DrawRectangle(Pens.SaddleBrown, wall);
				// Draws the wall onto the form with peruvian interior and saddlebrown border.
			}
And now, you should have fully active walls on the form.