Player -> Car
|Top Previous Next|
This time we're going to play with a project that allows the player to get in and out of a car and use it, just like they do it in the Halo / Driver / etc games. It all starts with a few unsuspecting enemies that are guarding the car. Oh, and before you start asking, I'm not using the template car code, but a simple, and yet fully function car snippet.
Sneak behind the enemy that is close to the car and get the gun on the ground by running into it.
Now shoot the first enemy using the left mouse button; if you don't move too much, his mate won't notice what has happened.
If you are hurt, you can use the health pack; better leave it here though, because you might need it later and I've only put 3 of these in the level.
Time to hop in the car: move close to it, and then press the "space" key to jump in. Drive the car using the cursor (arrow) keys; as you already know, the player moves using the WSAD keys.
You can get out of the car at any time by pressing the "space" key again, provided that the car is stopped (or almost stopped). Explore the rest of the level and kill all the enemies; you'll see how many of them are left in the upper right corner of the screen.
You can't fire while you are driving, so drive close enough to the enemies, get out of the car and start shooting at them. Use the car body as a cover whenever it is possible and you shouldn't have any problems.