Recording number of checkpoints passed
Your character needs some way to count how many walls he has successfully passed. You can do this by making the character count when he passes above or below a wall - because the game ends when he goes through a wall.
Before we can fix the problem, we need a simple game.
Setup
I'll start by adding sun lamps, and a ground.

          Ground Plane                 Main Shadow Lamp     Even Lighting
You may be wondering what &quot;Even Lighting&quot; is. It is what I call a setup where you have a few low power sun lamps, one pointing in each direction, elimination no-light zones and harsh shadows. The main Shadow lamp is positioned so it can cast it's shadow on the entire plane.
Set your main sun lamp to only cast a shadow in its own layer.

This is important for when you add the top plane. Depending on your game setting, the top plane could be a sky, a tunnel roof, the inside of a building, really anything you want it to be.
Add a plane to be the top of the world, on a different layer. This is so the shadow lamp will not effect your sky plane, and as a result, the sky will not block all the light.

Now we need a character. You could use something as pretty as a mech or a jet fighter, or you could just use a cube. Modeling is usually the funnest part. I'll be using a cube here, because I need to leave something fun for you to do.
Add a camera and position it however you want. Parent it to a cube

Important: paint the cube blue.

This is an important step, because the awesomeness of your game could be compromised if the cube is not blue. Trust me- I've tried.
You can use whatever logic you want on the cube to make it jump, or fly, depending on the setting of your game. If your game is a gun running along the ground and jumping over objects, you may want something as simple as this:

However, I'm going to make this cube into a flying spaceship, so I will use this logic setup:

This logic setup limits the distance the cube can fly, so he can not fly below the bottom plane, or above the top plane. I'm also going to do the opposite to the camera. (this is optional)
We need to copy the logic from the cube, to the camera.

Now, we need to modify the logic on the camera.

Now, the camera will move half as fast as the cube. (camera is parented to the cube so the camera already moved with the cube.) (+1) + (-.5) = .5
Now, the camera will move up and down half as fast as the cube

This provides a more awesome view of the cube.
Now we need a wall to emit. We also need a collision object for the cube to detect. this will be how the cube knows when it has successfully passed a wall.

The green cube has this logic

The green cube has these physics properties.

The wall cube has exactly the same physics properties and logic, except that the wall cube does not have the Boolean property PassedAnotherWall. Instead, it has the Boolean property Wall.
Now we Finally get to the wall emitter. This is what generates the level as you are playing.
I have four empties. one of them (Wall Control Empty) controls the other three. The other three empties are named Top, Middle and Bottom. You can probably guess which is which. This is the collapsed logic that randomly adds the walls.

This is what it looks like expanded.

Basically, this logic setup works as follows:
Every 75 logic ticks, it randomly selects one of the wall sections that will not be added. every time a wall piece is added, the collision detector cube is also added. Both the wall and the collision detector cubes contain the logic to move past the player, appearing like the player is moving.
We need to test this.

YAY it works!!!!
now we need to make the player cube respond to the wall pieces.

All we need now is a display to show how many walls the layer has successfully gotten by.
Add a text object and parent it to the camera. it should be positioned in a nice spot in front of the camera.

We first need to change the font, because the default font will not display in the game engine.

Now we can add a little logic and everything should work happily.

YAY!!!
there is only one more thing we should change. you can still see the green cube, which should be invisible. Also - I did not press Escape to exit the game engine - I hit a wall, and it exited automatically.

Final Test

It Works!!! Yay!!!
If you had any trouble following that, feel free to explore, take apart, reverse engineer, or base your game off of the Blend file.