XNA 4 3D Game Development by Example: Beginner's Guide


XNA 4 3D Game Development by Example: Beginner's Guide
eBook: $29.99
Formats: PDF, PacktLib, ePub and Mobi formats
$25.49
save 15%!
Print + free eBook + free PacktLib access to the book: $79.98    Print cover: $49.99
$49.99
save 37%!
Free Shipping!
UK, US, Europe and selected countries in Asia.
Also available on:
Overview
Table of Contents
Author
Support
Sample Chapters
  • Learn the structure of a 3D world and how to implement a variety of 3D techniques including terrain generation and 3D model rendering.
  • Build three different types of 3D games step-by-step, including a first-person maze game, a battlefield tank game, and a 3D sidescrolling action game on the surface of Mars.
  • Learn to utilize High Level Shader Language (HLSL) to add lighting and multi-texturing effects to your 3D scenes.

Book Details

Language : English
Paperback : 322 pages [ 235mm x 191mm ]
Release Date : September 2012
ISBN : 1849687080
ISBN 13 : 9781849687089
Author(s) : Kurt Jaegers
Topics and Technologies : All Books, Game Development, Beginner's Guides, Enterprise

Table of Contents

Preface
Chapter 1: Introduction to XNA
Chapter 2: Cube Chaser – A Flat 3D World
Chapter 3: Cube Chaser – It's A-Mazing!
Chapter 4: Cube Chaser – Finding Your Way
Chapter 5: Tank Battles – A War-torn Land
Chapter 6: Tank Battles – The Big Guns
Chapter 7: Tank Battles – Shooting Things
Chapter 8: Tank Battles – Ending the War
Chapter 9: Mars Runner
Chapter 10: Mars Runner – Reaching the Finish Line
Index
  • Chapter 1: Introduction to XNA
    • System requirements
    • Installing the Windows Phone SDK
    • Time for action – installing Windows Phone SDK
    • Speller – Our first XNA game
    • Time for action – creating an XNA project
    • Managing content
    • Time for action – creating content assets
    • Member variables
    • Time for action – declaring new member variables
    • The Game1 constructor
    • Initialization
    • Time for action – customizing the Initialize() method
    • Loading content
    • Time for action – creating a square texture
    • Updating
    • Time for action – customizing the Update() method
    • The Draw() method
    • Time for action – drawing Speller
    • Helper methods
    • Time for action – words and letters
    • Time for action – completing the Speller project
    • Summary
    • Chapter 2: Cube Chaser – A Flat 3D World
      • Designing the game
        • 3D coordinates
      • Creating the project
      • Time for action – creating the Cube Chaser project
      • Our view of the world
      • Time for action – beginning the Camera class
      • The Projection matrix
      • Looking at something
      • Time for action – implementing a look-at point
      • The View matrix
      • Time for action – the View matrix
      • From the ground up
      • Time for action – creating the Maze classes
      • Drawing the floor
      • Time for action – drawing the floor
      • Moving around
      • Time for action – expanding the Camera
      • Time for action – letting the player move
      • Summary
      • Chapter 3: Cube Chaser – It's A-Mazing!
        • Maze generation
        • Time for action – defining a MazeCell
        • Time for action – generating the Maze class
        • Constructing the walls
        • Time for action – building walls
        • Time for action – drawing the walls
        • Solid walls
        • Time for action – bouncing off the walls
        • Summary
        • Chapter 4: Cube Chaser – Finding Your Way
          • The cube
          • Time for action – placing the cube
            • Rotating the cube
          • Time for action – rotating the cube
          • Matrices – big scary math things?
            • The translation matrix
            • The rotation matrix
            • The scale matrix
            • Combining matrices
            • What does it all mean?
          • Positioning the cube
          • Time for action – randomly positioning the cube
          • Catching the cube
          • Time for action – catching the cube
          • Summary
          • Chapter 5: Tank Battles – A War-torn Land
            • Creating the project
            • Time for action – creating the Tank Battles project
            • An arc-ball camera
            • Time for action – the ArcBallCamera class – part 1
            • Time for action – finishing the ArcBallCamera class
            • Building the playfield
              • Height maps
              • Generating the terrain
            • Time for action – generating the terrain
              • Height data
          • Time for action – adding the ReadHeightMap() method
            • Building vertices
          • Time for action – adding the BuildVertexBuffer() method
            • Building the indices
          • Time for action – the buildIndexBuffer() method
          • Let's see the terrain already!
          • Time for action – drawing the terrain
          • Adding texture – a gentle introduction to HLSL
            • Declaring variables
          • Time for action – HLSL declarations
            • The vertex shader structures
          • Time for action – Vertex Shader Input and Output definition
            • The vertex shader
          • Time for action – the vertex shader
            • The pixel shader
          • Time for action – the pixel shader
          • Time for action – utilizing Terrain.fx
          • Moving the camera
          • Time for action – moving the camera with the mouse
          • Summary
            • Chapter 6: Tank Battles – The Big Guns
              • Adding the tank model
              • Time for action – adding the tank model
              • Building tanks
              • Time for action – building the Tank class
                • Bringing things down to earth
              • Time for action – terrain heights
                • Animating the tank
              • Time for action – tank animation
                • The combatants
              • Time for action – positioning tanks
              • Summary
              • Chapter 7: Tank Battles – Shooting Things
                • Interface components
                  • The UIWidget class
                • Time for action – creating the UIWidget class
                  • UITextblocks
                • Time for action – creating UITextblocks
                  • UIButtons
                • Time for action – creating buttons
                  • Working with our UI objects
                • Time for action – adding the UIHelper class
                  • Creating the user interface
                • Time for action – creating the UI
                  • Responding to interface events
                • Time for action – responding to events
                  • Firing shots
                • Time for action – ShotManager-part 1
                  • Particles in 3D
                    • Billboarded particles
                • Time for action – the Particle class-part 1
                • Time for action – finishing the Particle class
                  • Managing particles
              • Time for action – the ParticleManager class
                • HLSL for our particles
              • Time for action – building Particles.fx
                • Adding particles
              • Time for action – implementing particles
              • Summary
                • Chapter 8: Tank Battles – Ending the War
                  • Managing game states
                  • Time for action – implementing a title screen
                    • From Playing to GameOver
                  • Time for action – detecting hits
                  • Managing turns
                  • Time for action – managing turns
                  • Visual improvements
                    • Lighting
                  • Time for action – computing normals
                    • Diffuse lighting
                • Time for action – HLSL for lighting
                  • Ambient lighting
                • Time for action – using ambient light
                  • Multitexturing
                • Time for action – multitexturing
                • Summary
                  • Chapter 9: Mars Runner
                    • Design of Mars Runner
                    • Getting started with the GSM sample
                    • Time for action – creating the Mars Runner solution
                      • The GameScreen abstract class
                      • Customizing the default ScreenManager screens
                    • Time for action – customizing the BackgroundScreen class
                    • Time for action – updating the menu
                      • Adding a new screen
                    • Time for action – creating the MarsRunnerPlayScreen class
                    • A new camera
                    • Time for action – the stationary camera
                    • Creating the background
                    • Time for action – creating a skybox
                    • Building the Martian surface
                      • Simplified heightmaps
                    • Time for action – beginning the MarsTrack class
                    • Time for action – generating the track
                      • Drawing the track
                    • Time for action – drawing the track
                    • Summary
                    • Chapter 10: Mars Runner – Reaching the Finish Line
                      • Abstracting support for 3D models
                      • Time for action – the GameEntity class
                      • Building the rover
                      • Time for action –building the rover
                      • Time for action – accepting user input
                      • Animating the planet
                      • Time for action – moving the world
                      • Animating the rover
                      • Time for action – animating the rover
                      • Crashing into craters
                      • Time for action – detecting craters
                      • Adding an enemy
                      • Time for action – the basic flying saucer
                      • Time for action – flying the saucer
                      • Shots and collisions
                      • Time for action – Shot classes
                      • Time for action – the ShotManager class
                        • Enemy shots
                      • Time for action – enemy shots
                      • Time for action – player shots versus aliens
                      • Time for action – enemy shots versus the rover
                      • Scoring
                      • Time for action – scoring
                      • Time for action – the GameOver screen
                      • Sound effects
                      • Time for action – building the SFXManager class
                        • Triggering sounds
                    • Time for action – playing sound effects
                    • Summary

                      Kurt Jaegers

                      Kurt Jaegers is an Oracle Database Administrator and Windows Network Administrator, as well as a long-time hobbyist game developer. He has built games for everything from the Commodore 64 to the Xbox 360. He is the owner of xnaresources.com, and the author of XNA 4.0 Game Development by Example: Beginner's Guide (C# edition) and XNA 4.0 Game Development by Example: Beginner's Guide – Visual Basic Edition, both of which were published by Packt Publishing.

                      Sorry, we don't have any reviews for this title yet.

                      Code Downloads

                      Download the code and support files for this book.


                      Submit Errata

                      Please let us know if you have found any errors not listed on this list by completing our errata submission form. Our editors will check them and add them to this list. Thank you.


                      Errata

                      - 1 submitted: last submission 26 Mar 2013

                      Errata Type: Code | Page No.: 106

                      The last line (other than the line with a single { ) should read:

                      for (short x = 0; x < width - 1; x++)

                      (replacing “height” in the existing text with “width”). The code works because we are dealing with a square, so height and width are the same value, but if the reader uses a non-square heightmap this would introduce an error.

                      Sample chapters

                      You can view our sample chapters and prefaces of this title on PacktLib or download sample chapters in PDF format.

                      Frequently bought together

                      XNA 4 3D Game Development by Example: Beginner's Guide +    IBM WebSphere eXtreme Scale 6 =
                      50% Off
                      the second eBook
                      Price for both: $45.60

                      Buy both these recommended eBooks together and get 50% off the cheapest eBook.

                      What you will learn from this book

                      • The core concepts of 3D graphics and how XNA describes the 3D world
                      • Build a 3D maze that the player can explore in search of the mysterious spinning cube
                      • Create 3D terrain based on a 2D height map image, adding texturing and lighting to the terrain’s surface
                      • Load, display and animate 3D models
                      • Build a button-based user interface overlay for your 3D game
                      • Create a billboard particle system to produce dynamic explosions
                      • Build a skybox to give your worlds full 3D backgrounds
                      • Detect collisions between 3D objects and have your game react accordingly

                      In Detail

                      Move beyond the world of flat 2D-based game development and discover how to create your own exciting 3D games with Microsoft XNA 4.0. Create a 3D maze, fire shells at enemy tanks, and drive a rover on the surface of Mars while being attacked by alien saucers.

                      "XNA 4 3D Game Development by Example: Beginner's Guide" takes you step-by-step through the creation of three different 3D video games with Microsoft XNA 4.0. Learn by doing as you explore the worlds of 3D graphics and game design.

                      This book takes a step-by-step approach to building 3D games with Microsoft XNA, describing each section of code in depth and explaining the topics and concepts covered in detail.
                      From the basics of a 3D camera system to an introduction to writing DirectX shader code, the games in this book cover a wide variety of both 3D graphics and game design topics. Generate random mazes, load and animate 3D models, create particle-based explosions, and combine 2D and 3D techniques to build a user interface.

                      "XNA 4 3D Game Development by Example: Beginner's Guide" will give you the knowledge to bring your own 3D game creations to life.

                      Approach

                      This book is a step-by-step tutorial that includes complete source code for all of the games covered. It adopts an engaging style to teach all the game development concepts. Each block of code is explained, and game development concepts are diagrammed and covered in detail. Each game begins with a concept description and concludes with suggestions for expanding on the finished game.

                      Who this book is for

                      This book is intended for readers who want to create 3D games using the XNA Framework. Basic knowledge of the C# programming language and 2D XNA concepts are helpful, but not required.

                      Code Download and Errata
                      Packt Anytime, Anywhere
                      Register Books
                      Print Upgrades
                      eBook Downloads
                      Video Support
                      Contact Us
                      Awards Voting Nominations Previous Winners
                      Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
                      Resources
                      Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software