Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 21. Improving the Game > Creating the Tunnel

Creating the Tunnel

With a name like tunnel vision, it would be wise to actually add a tunnel to the game. We need to create a code file named Tunnel.cs for our projects. This file will have all of the normal using statements. The class will inherit from the DrawableGameComponent. The member fields we will need for the Tunnel class are as follows:

private VertexPositionNormalTangentTexture[] vertices;
private short[] indices;
private VertexDeclaration vertexDeclaration;

private Effect effect;
private Texture2D colorMap;
private Texture2D normalMap;

public Matrix View;
public Matrix Projection;

private TunnelVision ourGame;


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint