Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
Cover
Title
Copyright
Contents at a Glance
Contents
About the Author
About the Technical Reviewer
Acknowledgments
Introduction
Chapter 1: Getting Started
A Closer Look at Visual Studio Development for Windows 8 and Windows Phone 8
Language Choices
IDE Features
Windows 8 Devices
Screen Hardware
Hardware Buttons
Graphics Hardware
Location and Orientation
Cooperation with the Device
Windows Phone Devices
Screen Hardware
Hardware Buttons
Processors
Graphics Hardware
Location and Orientation
Cooperation with the Device
Using Visual Studio for Windows 8 and Windows Phone Development
Installing Visual Studio
Creating a Windows Store Project
Project Templates
Designing a Page
Running the Application
Running in the Simulator
Running on an External Device
Creating a Windows Phone Project
Project Templates
Designing a Page
Running in the Emulator
Running on a Real Device
Debugging
Breakpoints
Debug Output
Cross-Platform Development
Building Entirely Separate Projects
Using Shared Source Files
Choosing a Development Approach
Getting Help
MSDN
Search Engines
Microsoft’s Windows Phone Developer Center
Game Development
Suitable Games
Welcome to the World of Windows 8 and Windows Phone Development
Summary
Chapter 2: Getting Started with MonoGame
What Is MonoGame?
Installing MonoGame
Creating a MonoGame Project
Creating a MonoGame Project for Windows 8
Creating a MonoGame Project for Windows Phone
Adding Some Content
Adding the Sprite Graphic to the Project
Displaying the Graphic
Moving the Graphic
Examining the Projects in More Detail
Sharing Graphic Resources between Windows 8 and Windows Phone
Sprites in Detail
Supported Graphic Formats
Scaling
Rotation
Tinting
Partial Image Rendering
Layer Depth
Sprite Transparency
Alpha Tinting
Useful Sprite Effects
Setting a Background Image
Fading to Black
Fading between Images
Displaying Text
Font Support
Creating SpriteFont Objects
Displaying Text
Supporting Portrait and Landscape Orientations
Orientation in Windows 8 Projects
Orientation in Windows Phone Projects
Detecting Orientation Changes
Experiment and Play with MonoGame
Summary
Chapter 3: Creating a Game Framework
Designing the Game Framework
The GameObjectBase Class
The SpriteObject Class
The TextObject Class
The GameHost Class
The GameHelper Class
Using the Game Framework
Referencing the GameFramework Project
Setting Inheritance for the Main Game Class
Creating Derived SpriteObject classes
Adding Game Objects to the Game Host
Removing Objects from the Game Host
Overriding Object Properties
Benchmarking and Performance
Using the Frame Rate Counter
The BenchmarkObject Class
Using BenchmarkObject
Performance Considerations
An Example Game: Cosmic Rocks (Part 1)
Designing the Game
Creating the Graphics
Creating the Game Objects
Running the Game
Creating MonoGame Games
Summary
Chapter 4: User Input
Detecting Input Capabilities
Using the Touch Screen
Reading Raw Touch Data
Reading Input Using Touch Gestures
Sprite Hit Testing
Initiating Object Motion
Finger-Friendly Gaming
Reading Mouse Input
Reading Mouse State Data
Reading from a Compatible Gamepad
Detecting Gamepad Connections and Capabilities
Reading Gamepad State Data
Reading the Keyboard and Text Input
Reading a Hardware Keyboard
Prompting the User to Enter Text
Reading the Accelerometer
Accessing the Accelerometer
Reading the Accelerometer Data
Using the Accelerometer in the Simulator and Emulator
Handling the Windows Phone Back Button
An Example Game: Cosmic Rocks (Part II)
Making the Player’s Ship Shoot
Rotating the Ship
Making the Player’s Ship Move
Implementing Hyperspace
Considering Input Design
Summary
Chapter 5: Sounding Out with Game Audio
Sound Effects and Music
Playing Sound Effects
Adding Sound Effects to Your Project
Playing the Sound Effects
Integrating Sound Effects into the Game Framework
Sound Effect Instances
Other Sound Effect Properties
Obtaining Sound Effects for Your Game
An Interactive Example
Playing Music
To Play or Not to Play
Adding Music to Your Project
Playing the Music
An Example Game: Cosmic Rocks Part III
Make Some Noise
Summary
Chapter 6: Drawing with Vertices and Matrices
A New Approach to Drawing
Matrix-Based Positioning
Abstract Coordinate System
Drawing Primitives
Textures
MonoGame Is a State Engine
Creating Our First Vertex Rendering Project
Setting Up the Environment
Rendering the Object
Moving the Object
Adding Some Sparkle
Tinting Objects
Understanding Matrix Transformations
Setting the Identity Matrix
Applying Translation Transformations
Applying Rotation Transformations
Applying Scaling Transformations
Applying Multiple Transformations
Specifying Vertex Positions
Drawing Multiple Objects at Different Positions
Drawing Primitives
Drawing Lines
Drawing Triangles
Drawing Points
Applying Textures
Loading Graphics
Setting the Active Texture
Applying the Texture to an Object
Preparing the Effect for Texture Mapping
Configuring the Sampler State
Supported Texture Image Formats
Using Different Textures within the Same Draw Call
Using Transparency and Alpha Blending
Enabling and Disabling Alpha Blending
MonoGame’s Built-In Blend States
Creating Custom Blend States
Object Transparency
Handling Orientations
Integration into the Game Framework
The MatrixObjectBase Class
Updates to the GameHost Class
Using the Game Framework for Matrix Rendering
Enter the Matrix
Summary
Chapter 7: The World of 3-D Graphics
Perspective Projection
The Viewing Frustum
Defining the Viewing Frustum in MonoGame
Rendering 3-D Objects
Defining a 3-D Object
The Depth Buffer
Enabling and Disabling the Depth Buffer
Clearing the Depth Buffer
Rendering Transparent Objects with the Depth Buffer
Hidden Surface Culling
Vertex and Index Buffers
Using Vertex Buffers
Using Indexed Vertices
Using Vertex Buffers and Indexing Together
Lighting
Lights and Materials
Types of Illumination
Material Properties
Light and Material Interaction
Using Multiple Lights
Reusing Lights
Types of Light Source
How MonoGame Calculates Light Reflections
Adding Lighting to Games
Orthographic Projection
The Viewing Frustum
Defining the Orthographic Viewing Frustum in MonoGame
Isometric Projection
Pixel-Aligned Projection
Mastering the 3-D World
Summary
Chapter 8: Further 3-D Features and Techniques
Importing Geometry
SketchUp
Importing Saved Geometry into MonoGame Projects
Final Preparation Prior to Rendering
Rendering Imported Geometry
Adding Support into the Game Framework
The SketchUp 3-D Warehouse
Importing Other File Formats
Working with the Camera
Camera Position and Orientation
Integrating Camera Support into the Game Framework
Creating a Chase Cam
Adding Fog
Adding a Skybox
Creating Skyboxes
Implementing the Skybox into the Game Framework
Particles
How Particles Are Implemented
Billboarding
Adding Particle Support to the Game Framework
Creating Fire and Smoke
Vapor and Smoke Trails
Fairy Dust
Using Effect Objects
Effect Capabilities
AlphaTestEffect
DualTextureEffect
EnvironmentMapEffect
SkinnedEffect
Mixing Sprite and Matrix Rendering
A Universe of Possibilities
Summary
Chapter 9: Enhancing Your Game
Managing Multiple Game Modes
Multiple Mode Support in the Game Framework
Defining Game Mode Classes
Registering the Game Modes
Activating and Interrogating the Game Mode Handlers
Using the Game Mode Classes
Managing Game Settings
Class Structure
Setting and Retrieving Values
Creating the Settings User Interface
Adding a High-Score Table
Implementing the High-Score Table
Using the HighScore Classes in a Game
Creating Reusable Game Components
Summary
Chapter 10: Application Management
Managing the Application Life Cycle
The Application Life Cycle in Windows 8 Apps
The Application Life Cycle in Windows Phone Apps
Responding to the Game Window Resizing
Detecting When the Window Size Changes
Handling Window Size Changes
Summary
Chapter 11: Getting Started with XAML
A Brief History of XAML
Windows Presentation Foundation
Silverlight
Silverlight on Windows Phone 7
XAML on Windows 8 and Windows Phone 8
Creating XAML Projects for Windows 8 and Windows Phone 8
Working with XAML Projects
The Hidden Source Files
Exploring XAML
What Is XAML For?
The Page Structure
XAML’s Syntax
Working with the Page Designer
Adding and Positioning Elements
The Document Outline Window
Using the Properties Window
Understanding Control Alignment
Colors and Brushes
Color Specifications
Brushes
Setting Colors in Code
Using Brushes Together
Exploring XAML
Summary
Chapter 12: XAML Controls and Pages
The XAML Controls
Display Controls
Interactive Controls
Layout Controls
User Interface Design
Orientation
Multiple Page Projects
Adding New Pages to a Project
Navigating between Pages
Passing Values When Navigating
But What about MonoGame?
Summary
Chapter 13: Mixing XAML and MonoGame
Using MonoGame and XAML Together
Communication between the Game and the Page
Updating XAML Controls from the Game Class
Notifying the Game Class from the XAML Page
Using the Application Bar
Page Navigation
Page Navigation in Windows 8
Page Navigation in Windows Phone
Summary
Chapter 14: Distributing Your Game
Trial Mode
Working with Trial Mode in Windows 8 Apps
Working with Trial Mode in Windows Phone Apps
Submission Requirements
Content Policies
Application Requirements
Application Features
Reliability and Performance
Technical Information
Music and Sound
Testing Your Game
Testing for Windows 8
Testing for Windows Phone
Considerations Prior to Distribution
Persuading People to Review Your Game
Adding Items to the Windows 8 Charms Bar
Preparing for Distribution
Updating the Application Manifest File
Managing the Application Version
Preparing Screenshots for the Store
Selling or Giving Your Game for Free
Offering Your Game to Beta Testers
Automated Application Testing
Submitting Your Game to the Store
Rating Certificates
Submitting a Game to the Windows Store
Submitting a Game to the Windows Phone Store
Keeping Track of Your Published Apps
Submitting Revisions
Go Create!
Summary
Index
← Prev
Back
Next →
← Prev
Back
Next →