Today I worked through the remainder of the online tutorial I started yesterday. With the terrain in the game, I had to add a player character, which I chose to be a plane. So I added the plane and set up controls for it. Along the way, I added a lot of things like sky and collision detection. So now if you run into the ground, there will be an explosion and your plane is reset. The sky is basically just a cube that is placed around the game terrain with an image of sky pasted onto it. If you run into the edge of the world, then you stick and stop moving. I also added other planes to fly around the terrain. I had to add some kind of intelligent AI to the planes, so that they would could fly around without any control from the player. The computer controlled planes use the same model as the player controlled plane, but for the texture that is applied to the model, I just took the player controlled plane texture and reversed the colors, so they look different. There is sound as well. The plane makes an engine sound, that gets louder when you increase the speed of the plane. There is also a satisfying explosion sound when you hit the ground. I also added a picture-in-picture feature. If you hold down the p key, then it will show views of three of the other planes to the right of the screen. There is also a radar, so you can see the positions of the other planes.
Below is a video I took of the game in action. The quality of the video is lower than I would have liked, so the game actually looks better than the video. Some things to look for:
0:01-0:07: I have to run the game from the command line through the python interpreter. This brings all the panda libraries and everything I need together so that the game can use them.
0:11: Notice the radar in the bottom left corner of the screen. This is handy, since the other planes are pretty small and fast, so can be hard to find sometimes without it.
0:15: Some planes fly past and I follow one of them. Notice how, with just 10 seconds of work, they look completely different from the player's plane.
0:23: I accelerate the plane. When the player speeds up, the plane gets farther from the camera, giving a nice feeling of speed.
0:26: Doing a barrel roll
0:36: I crash. The explosion needs to be tweaked, as sometimes it is hard to see. You can't see it at all here.
0:40: I slow to a complete stop, and the gravity I programmed in takes over and the plane falls to crash again, this time showing the explosion animation.
0:51: I turn on the picture-in-picture feature. Having four cameras rolling simultaneously is hard work for the computer, so it slows the game down considerably.
1:06: I come to the end of the game world and stop at the edge. The status indicator in the top left changes to tell me that I need to turn around.
No comments:
Post a Comment