Learning XNA 4.0. Aaron Reed O'REILLY8. Cambridge. Beijing. Sebastopoi. Tokyo. Farnham Koln

Similar documents
Z-Town Design Document

From: urmind Studios, FRANCE. Imagine Cup Video Games. MindCube

INTRODUCTION TO GAME AI

3D Game Engine Design Using DirectX 9 and C#

Introduction to Game Design. Truong Tuan Anh CSE-HCMUT

2D Games. My Game: DawgShower. Screen Shot 9/21/09. Shoot the bad dawgs! Consist of four main objects. The moving objects are all made of sprites

D E S I G N D O C U M E N T

GAME PROGRAMMING & DESIGN LAB 1 Egg Catcher - a simple SCRATCH game

Naturey Snake. Cal Poly Computer Science Department. By Oliver Wei Hao Xia Fall 2015 SENIOR PROJECT REPORT

CRYPTOSHOOTER MULTI AGENT BASED SECRET COMMUNICATION IN AUGMENTED VIRTUALITY

Requirements Specification. An MMORPG Game Using Oculus Rift

Nighork Adventures: Legacy of Chaos

Cannon Ball User Manual

@3 [fijl)~ 8: ~ 0 ~~ ~~~ C

Creating Computer Games

Team: Couch Potato Gaming. Ohio State Computer Science/Engineering 5912 Capstone. Game Design Document

Sensible Chuckle SuperTuxKart Concrete Architecture Report

Beginning 3D Game Development with Unity:

3D Top Down Shooter By Jonay Rosales González AKA Don Barks Gheist

Nighork Adventures: Beyond the Moons of Shadalee

Parametric Modeling. with. Autodesk Inventor Randy H. Shih. Oregon Institute of Technology SDC

HERO++ DESIGN DOCUMENT. By Team CreditNoCredit VERSION 6. June 6, Del Davis Evan Harris Peter Luangrath Craig Nishina

1 Shooting Gallery Guide 2 SETUP. Unzip the ShootingGalleryFiles.zip file to a convenient location.

Principles and Practice:

Program a Game Engine from Scratch. Chapter 1 - Introduction

Unity 3.x. Game Development Essentials. Game development with C# and Javascript PUBLISHING

Design Document for: Name of Game. One Liner, i.e. The Ultimate Racing Game. Something funny here! All work Copyright 1999 by Your Company Name

Computer Games 2011 Engineering

CATIA V5 Workbook Release V5-6R2013

Principles and Practice

Is it possible to make a fun and easy game that can be played by anyone and contains no violence?

SOLIDWORKS 2015 and Engineering Graphics

Formal Game Proposal

The Complete Guide to Game Audio

Game Design Project 2, Part 3 Group #3 By: POLYHEDONISTS Brent Allard, Taylor Carter, Andrew Greco, Alex Nemeroff, Jessica Nguy

Shoot It Game Template - 1. Tornado Bandits Studio Shoot It Game Template - Documentation.

GAME PRODUCTION HANDBOOK Second Edition

Game Design Document (GDD)

CISC 1600, Lab 2.2: More games in Scratch

Pangolin: A Look at the Conceptual Architecture of SuperTuxKart. Caleb Aikens Russell Dawes Mohammed Gasmallah Leonard Ha Vincent Hung Joseph Landy

GAME:IT Junior Bouncing Ball

DM842 Computer Game Programming

The purpose of this document is to outline the structure and tools that come with FPS Control.

and Engineering Graphics

CONCEPTS EXPLAINED CONCEPTS (IN ORDER)

SPACEYARD SCRAPPERS 2-D GAME DESIGN DOCUMENT

CAPSTONE PROJECT 1.A: OVERVIEW. Purpose

WEB VIRTUAL BALL GAME POK-TA-POK

In this lesson we are going to create cartoon eyes and parent them to the head bone.

Analysis and Design of Autonomous Microwave Circuits

GALAXIAN: CSEE 4840 EMBEDDED SYSTEM DESIGN. Galaxian. CSEE 4840 Embedded System Design

Introduction. Video Game Programming Spring Video Game Programming - A. Sharf 1. Nintendo

Star Defender. Section 1

Competitive Games: Playing Fair with Tanks

NOVA. Game Pitch SUMMARY GAMEPLAY LOOK & FEEL. Story Abstract. Appearance. Alex Tripp CIS 587 Fall 2014

BooH pre-production. 4. Technical Design documentation a. Main assumptions b. Class diagram(s) & dependencies... 13

Fundamentals of Industrial Control

Royale Politique. A funny game developed for the RV course - University of Pisa

Lesson 2 Game Basics

VACUUM MARAUDERS V1.0

Unity Game Development Essentials

Storyboard for Playing the Game (in detail) Hoang Huynh, Jeremy West, Ioan Ihnatesn

Space Invadersesque 2D shooter

Introduction. Video Game Design and Development Spring part of slides courtesy of Andy Nealen. Game Development - Spring

How to Make Games in MakeCode Arcade Created by Isaac Wellish. Last updated on :10:15 PM UTC

Unity Certified Programmer

Federico Forti, Erdi Izgi, Varalika Rathore, Francesco Forti

Introduction... 1 Part I: Fast Track to Super Snaps Part II: Taking Creative Control Part III: After the Shot

Game Design Document. RELEASE December 18, Austin Krauss

If you have any questions or feedback regarding the game, please do not hesitate to contact us through

Beginning ios 3D Unreal

ADVANCED TOOLS AND TECHNIQUES: PAC-MAN GAME

Head Tracker Range Checking

Gaia is a system that enables rapid and precise creation of gorgeous looking Unity terrains. Version March 2016 GAIA. By Procedural Worlds

Fundamentals of Kalxnan Filtering: A Practical Approach

Space Cadet Grades K-2 Scope and Sequence

Module 4 Build a Game

Toon Dimension Formal Game Proposal

Zombie Arcade. Team 7 Technical Report. Jonathan Halbrook Alvaro Juban Jr. Brandon Ware

Introduction to Creo Parametric 2.0

MULTI AGENT SYSTEM WITH ARTIFICIAL INTELLIGENCE

Application Survey: Audiosurf

Game Programming Laboratory Conclusion report

Your First Game: Devilishly Easy

The 8 th International Scientific Conference elearning and software for Education Bucharest, April 26-27, / X

COMPUTING CURRICULUM TOOLKIT

04. Two Player Pong. 04.Two Player Pong

Brain Game. Introduction. Scratch

Mage Arena will be aimed at casual gamers within the demographic.

Warmup Due: Feb. 6, 2018

Game demo First project with UE Tom Guillermin

No Evidence. What am I Testing? Expected Outcomes Testing Method Actual Outcome Action Required

a. the costumes tab and costumes panel

Autodesk Inventor 2016

A retro space combat game by Chad Fillion. Chad Fillion Scripting for Interactivity ITGM 719: 5/13/13 Space Attack - Retro space shooter game

Surfing on a Sine Wave

Tower Defense. CSc 335 Fall Final Project

CS Game Programming, Fall 2014

Ada Lovelace Computing Level 3 Scratch Project ROAD RACER

Orbital Delivery Service

Transcription:

Learning XNA 4.0 Aaron Reed O'REILLY8 Beijing Cambridge Farnham Koln Sebastopoi Tokyo

Table of Contents Preface xiii 1. What's New in XNA 4.0? 1 Revised Project Folder Structure 1 Develop Games for Windows Phone 7 Series 2 Graphics Profiles 2 Configurable Effects 4 Built-in State Objects 5 Scalars and Orientation 5 Revised Input API 5 Additional Audio API 6 Music and Picture Enumeration and Video Playback 6 Modified and Added Classes and Methods 6 Test Your Knowledge: Quiz 6 2. Getting Started 7 System Requirements 7 Additional Resources 8 Installation 8 Creating Your First XNA Application 10 What You Just Did 13 Summary 13 Test Your Knowledge: Quiz 14 3. Fun with Sprites 15 A Look Behind the Scenes 15 Game Development Versus Polling 18 Modifying Your Game 21 Adding a Sprite to Your Project 22 Loading and Drawing Your Sprite 25 Transparency and Other Options 28 vii

Layer Depth 33 Let's Move 36 Animation 38 Adjusting the Framerate 43 Adjusting the Animation Speed 44 What You Just Did 45 Summary 46 Test Your Knowledge: Quiz 46 Test Your Knowledge: Exercise 47 4. User Input and Collision Detection 49 More Sprites 49 Keyboard Input 52 Mouse Input 54 Gamepad Input 56 Keeping the Sprite in the Game Window 59 Collision Detection 60 What You Just Did 65 Summary 65 Test Your Knowledge: Quiz 65 Test Your Knowledge: Exercise 66 5. Applying Some Object-Oriented Design 67 Designing Your Classes 67 Creating a Sprite Class 68 Creating a User-Controlled Sprite Class 72 Creating an Automated Sprite Class 74 Game Components 77 Coding the SpriteManager 78 Cleaning Up 80 Making Them Move 83 What You Just Did 83 Summary 84 Test Your Knowledge: Quiz 84 Test Your Knowledge: Exercise 84 6. Sound Effects and Audio 85 Using XACT 86 Implementing XACT Audio Files in Code 92 Using the Simplified API for Sound and Audio 94 Adding More Sound to Your Game 96 What You Just Did 100 Summary 100 viii Table of Contents

Test Your Knowledge: Quiz 101 Test Your Knowledge: Exercise 101 7. Basic Artificial Intelligence 103 The Turing Test 104 Creating Sprites at Random Intervals 104 Randomly Spawning Sprites 106 Irrelevant Objects 110 Creating a Chasing Sprite 112 Creating an Evading Sprite 117 What You Just Did 123 Summary Test Your Knowledge: Quiz 124 Test Your Knowledge: Exercise 124 123 8. Putting It All Together 125 Drawing 2D Text 126 Randomly Generating Different Sprite Types 132 Adding Some Variety to Your Sprites 133 Adding a Background Image 139 Game Scoring 140 Game States 147 Enabling/Disabling GameComponents 150 Game-Over Logic and the Game-Over Screen 153 Fine-Tuning Gameplay 161 Creating Power-Ups 164 What You Just Did 168 Summary Test Your Knowledge: Quiz Test Your Knowledge: Exercise 169 169 169 9. 3D Game Development 171 Coordinate Systems 171 Cameras 173 Creating a 3D Camera 176 Drawing Primitives 178 Matrix Multiplication Movement and Rotation 184 Backface Culling 187 More on Rotations 188 Even More Rotations 190 Primitive Types 191 Applying Textures 195 183 Table ofcontents ix

What You Just Did 198 Summary 199 Test Your Knowledge: Quiz 200 Test Your Knowledge: Exercise 200 10. 3D Models 201 Using 3D Models 201 Setting Up the Project 202 Adding a Model to Your Project 205 Drawing a Model Using a BasicModel Class 206 Adding a Model Manager 210 Rotating Your Model 212 What You Just Did 214 Summary 215 Test Your Knowledge: Quiz 216 Test Your Knowledge: Exercise 216 11. Creating a First-Person Camera 217 Components of a Moving 3D Camera 217 Moving in a First-Person Camera 221 Rotations in a First-Person Camera 224 a Rotating Camera in a Yaw 226 Rotating a Camera in a Roll 227 Rotating a Camera in a Pitch 228 Coding the Camera for the 3D Game 229 What You Just Did 233 Summary 233 Test Your Knowledge: Quiz 234 Test Your Knowledge: Exercise 234 12. 3D Collision Detection and Shooting 235 Creating a Moving Enemy 235 Adding Some Game Logic 237 Firing Shots 246 3D Collision Detection and Bounding Spheres 251 Adding a Crosshair 253 Adding Sound 256 What You Just Did 262 Summary 262 Test Your Knowledge: Quiz 263 Test Your Knowledge: Exercise 263 x Table of Contents

13. HLSL Basics 265 HLSL Syntax 267 Dissecting a Sample HLSL Effect File 269 Applying an HLSL Effect in C# 277 Applying HLSL Using Textures 285 HLSL Effects: Creating a Negative 293 HLSL Effects: Blur 293 HLSL Effects: Grayscale 295 What You Just Did 296 Summary 296 Test Your Knowledge: Quiz 297 Test Your Knowledge: Exercise 297 14. Particle Systems 299 Creating a Particle Engine 299 Adding a Particle Effect File 310 Adding Your Particle Engine to Your Game 312 Adding a Starfield 315 What You Just Did 320 Summary 321 Test Your Knowledge: Quiz 321 15. Wrapping lip Your 3D Game 323 Adding a Splash Screen Game Component 323 Keeping Score 334 Adding a Power-Up 338 What You Just Did 343 Test Your Knowledge: Exercise 344 16. Deploying to the Xbox 360 345 Adding an Xbox 360 Device 345 Converting a Project to Run on the Xbox 360 349 Supporting Gamepad Input 351 Deploying to the Xbox 360 358 Xbox 360 Display Settings 360 The Title Safe Region 361 What You Just Did 363 Summary 363 Test Your Knowledge: Quiz 363 17. Developing for Windows Phone 7 365 Setting Up Your Windows Phone 7 Device 365 Table ofcontents xi

Registering for a Developer Account 366 Registering Your Windows Phone 7 Device 368 Unlocking Your Phone 369 Creating a Windows Phone 7 Project 370 Resources 372 Digging In 373 Screen Rotation and Resolution 378 More Model Classes 380 Adding a ModelManager 386 Finishing Details 391 What You Just Did 395 Summary 395 Test Your Knowledge: Quiz 395 18. Multiplayer Games 397 Split-Screen Functionality 397 Network Game Development 406 Network Configurations 408 Writing an XNA Network Game 410 Modifying the Sprite Class 411 Modifying the UserControlledSprite Class 411 Coding Your Game 1 Class 414 Adding Update Code 417 Updating While in the Signln Game State 418 Updating While in the FindSession Game State 419 Updating While in the CreateSession GameState 422 Updating While in the Start Game State 422 Updating While in the InGame Game State 430 Updating While in the GameOver Game State 431 Adding Draw Code 432 Adding Biohazard Bombs of Insanity! 438 What You Just Did 444 Summary 445 Test Your Knowledge: Quiz 446 Appendix: Answers to Quizzes and Exercises 447 Index 501 xii I Table of Contents