Cisc

Páginas: 336 (83989 palabras) Publicado: 27 de noviembre de 2012
Learning XNA 4.0

Learning XNA 4.0

Aaron Reed

Beijing • Cambridge • Farnham • Köln • Sebastopol • Tokyo

Learning XNA 4.0
by Aaron Reed
Copyright © 2011 Aaron Reed. All rights reserved. Printed in the United States of America. Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472. O’Reilly books may be purchased for educational, business, orsales promotional use. Online editions are also available for most titles (http://my.safaribooksonline.com). For more information, contact our corporate/institutional sales department: (800) 998-9938 or corporate@oreilly.com.

Editor: Courtney Nash Production Editor: Kristen Borg Copyeditor: Genevieve d’Entremont Proofreader: Kristen Borg Printing History:
December 2010: First Edition.

Indexer:Fred Brown Cover Designer: Karen Montgomery Interior Designer: David Futato Illustrator: Robert Romano

Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are registered trademarks of O’Reilly Media, Inc. Learning XNA 4.0, the image of a sea robin fish, and related trade dress are trademarks of O’Reilly Media, Inc. Many of the designations used by manufacturers and sellers todistinguish their products are claimed as trademarks. Where those designations appear in this book, and O’Reilly Media, Inc., was aware of a trademark claim, the designations have been printed in caps or initial caps.
While every precaution has been taken in the preparation of this book, the publisher and author assume no responsibility for errors or omissions, or for damages resulting from theuse of the information contained herein.

ISBN: 978-1-449-39462-2 [M] 1291906059

To my mother and father, who, after shelling out $2,500 in the 1980’s for a sweet Compaq 286 with a 4-color monitor, 16k internal memory, a 5 1/4" floppy and no internal hard drive, didn’t yell at me when they came home and found that I’d taken the thing apart. I’ve been hooked ever since.

Table of ContentsPreface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii 1. What’s New in XNA 4.0? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Revised Project Folder Structure Develop Games for Windows Phone 7 Series Graphics Profiles Configurable EffectsBuilt-in State Objects Scalars and Orientation Revised Input API Additional Audio API Music and Picture Enumeration and Video Playback Modified and Added Classes and Methods Test Your Knowledge: Quiz 1 2 2 4 5 5 5 6 6 6 6

2. Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
System Requirements Additional ResourcesInstallation Creating Your First XNA Application What You Just Did Summary Test Your Knowledge: Quiz 7 8 8 10 13 13 14

3. Fun with Sprites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
A Look Behind the Scenes Game Development Versus Polling Modifying Your Game Adding a Sprite to Your Project Loading and Drawing Your SpriteTransparency and Other Options 15 18 21 22 25 28

vii

Layer Depth Let’s Move Animation Adjusting the Framerate Adjusting the Animation Speed What You Just Did Summary Test Your Knowledge: Quiz Test Your Knowledge: Exercise

33 36 38 43 44 45 46 46 47

4. User Input and Collision Detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
More Sprites KeyboardInput Mouse Input Gamepad Input Keeping the Sprite in the Game Window Collision Detection What You Just Did Summary Test Your Knowledge: Quiz Test Your Knowledge: Exercise 49 52 54 56 59 60 65 65 65 66

5. Applying Some Object-Oriented Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
Designing Your Classes Creating a Sprite Class Creating a User-Controlled...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Cisco
  • Cisco
  • CISCO
  • cisco
  • cisco
  • cisco
  • Cisco
  • cisco

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS