Microsoft XNA 4.0 Game Development Cookbook ppt

357 1.5K 0
Microsoft XNA 4.0 Game Development Cookbook ppt

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

[...]... If you are an XNA developer who has already successfully dabbled in some of the simple 2D and 3D functionality provided by XNA, and are eager to find out how to achieve some of the more advanced features presented in popular games, dive into the Microsoft XNA 4.0 Game Development Cookbook for an example-based approach that should have you safely on your way towards the next level of game creation You... your players can drag, drop, point, and type their way through your games Chapter 9, Networking: Expand your virtual world across to the real one by adding the ability to communicate What you need for this book To write games using the examples presented in this book, you'll need: ff Windows Vista (SP2) or later ff XNA Game Studio 4.0 (usually bundled as part of the Windows Phone SDK) or later For... environment, and for a lot of games written within the Reach profile, a simple static image of a dark patch beneath the character's feet is sufficient, as seen in the following illustration: There are, however, times where a non-descript blur isn't going to cut it, and a more realistic looking shadow is required This recipe will teach you how to create a detailed shadow of an in -game element, as seen in... Applying Special Effects 6 After drawing the game scene's floor, but prior to drawing the object to be shadowed, insert the following code to give the shadow transparency: graphicsDevice.BlendState = BlendState.AlphaBlend; graphicsDevice.DepthStencilState = DepthStencilState.DepthRead; 7 Drawing the object with the shadow effect will then render a shadow: gameObject.Draw(reachShadowEffect); 8 Setting... DepthStencilState.Default; gameObject.Draw(regularEffect); Downloading the example code You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com If you purchased this book elsewhere, you can visit http://www.packtpub com/support and register to have the files e-mailed directly to you How it works Utilizing one of the built-in transformations of the XNA framework,... HiDef profile's OcclusionQuery class can offer, this test can be beyond the processing resources available to a game (especially one running on either mobile or older hardware) The good news is that we do have a relatively cheap alternative that may just provide enough approximation for a game, and no one need be the wiser that the "proper" technique wasn't used, as the following illustration of the... the lens flare that are blocked by scenery: ShadowCaptureEffect = new BasicEffect(graphicsDevice) { DiffuseColor = Vector3.Zero, }; 9 Next, add an Update() method to the class: public void Update(GameTime gameTime, Matrix view, Matrix projection) { 10 Add in a check to determine if the lens flare is visible at all where the player is currently looking: view.Translation = Vector3.Zero; var projectedPosition... spriteBatch.End(); } 18 Next in our game code, we add an instance variable for the new lens flare: ReachLensFlare reachLensFlare; 19 Initialize an instance of the lens flare in the LoadContent() method: reachLensFlare = new ReachLensFlare(GraphicsDevice, Content); 22 Chapter 1 20 Inside the Draw() method, there are two parts The first part is where we draw the elements of the game scene which are likely to... target and blur in a similar fashion to the technique demonstrated in the Implementing lens flare within the Reach profile section of this chapter There's more… In the example, a simplified call to a game object's Draw() method was made, passing in the effect to be used in rendering If you're interested in how such a method might be constructed, sneak a peek at the Draw() method of the GeometricBuffer... huge amount of memory or processing power remains one of the great challenges in computer graphics While I may not be able to offer a perfect solution for every shadow-related problem you have in your games, I can at least get you started in the world of shadow creation through the demonstration of one of the more well-known techniques, shadow mapping, seen in the following illustration Getting ready .

Ngày đăng: 15/03/2014, 02:20

Từ khóa liên quan

Mục lục

  • Cover

  • Copyright

  • Credits

  • About the Author

  • About the Reviewers

  • www.PacktPub.com

  • Table of Contents

  • Preface

  • Chapter 1: Applying Special Effects

    • Introduction

    • Creating shadows within the Reach profile

    • Creating shadows within the HiDef profile

    • Implementing lens flare within the Reach profile

    • Implementing lens flare within the HiDef profile

    • Implementing smoke within the Reach profile

    • Creating explosions within the Reach profile

    • Creating explosions within the HiDef profile

  • Chapter 2: Building 2D and 3D Terrain

    • Introduction

    • Displaying hexagonal maps

    • Displaying 2D isometric maps

    • Importing and displaying 3D isometric maps

    • Generating 3D height maps

    • Creating block worlds within the Reach profile

    • Creating block worlds within the HiDef profile

  • Chapter 3: Procedural Modeling

    • Introduction

    • Modeling triangles

    • Modeling discs

    • Modeling spheres

    • Modeling tori

    • Modeling trees

  • Chapter 4: Creating Water and Sky

    • Introduction

    • Creating water within the HiDef profile

    • Building skyboxes within the Reach profile

    • Building skyboxes within the HiDef profile

    • Cloud generation within the Reach profile

  • Chapter 5: Non-Player Characters

    • Introduction

    • A* pathfinding

    • Character state machines

    • Constructing dialogue

    • Decentralizing behavior

  • Chapter 6: Playing with Animation

    • Introduction

    • Applying animation with SkinnedEffect

    • Motion capture with Kinect

    • Integrating rag doll physics

    • Rendering crowds

  • Chapter 7: Creating Vehicles

    • Introduction

    • Applying simple car physics

    • Implementing simple plane controls

    • Rendering reflective materials within the Reach profile

  • Chapter 8: Receiving Player Input

    • Introduction

    • Adding text fields

    • Creating dialog wheels

    • Dragging, dropping, and sliding

  • Chapter 9: Networking

    • Introduction

    • Connecting across a LAN

    • Connecting across the web

    • Synchronizing client states

  • Index

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan