This section of the documentation describes how to use DirectX and Visual C++ to create a 3-D Windows Store game. With Windows Store apps, Windows 8 introduces an app personality that embraces consumer trends such as touch, motion and proximity sensors, mobility, and other app experiences. This documentation shows how to create a 3-D game named Marble Maze that embraces new form factors such as tablets and also works on traditional desktop and laptop PCs.
Note
|
|---|
|
To download the Marble Maze source code, see DirectX marble maze game sample. |
Important
|
|---|
|
Marble Maze illustrates design patterns that we consider to be best practices for creating Windows Store games. You can adapt many of the implementation details to fit your own practices and the unique requirements of the game you are developing. Feel free to use different techniques or libraries when those better suit your needs. (However, always ensure that your code passes the Windows App Certification Kit.) When we consider a Marble Maze implementation to be essential for successful game development, we emphasize it in this documentation. |
We chose Marble Maze because it is relatively basic, but still demonstrates the breadth of features that are found in most games. It shows how to use graphics, input handling, and audio. It also demonstrates game mechanics such as rules and goals.
Marble Maze resembles the table-top labyrinth game that is typically constructed from a box that contains holes and a steel or glass marble. The goal of Marble Maze is the same as the table-top version: tilt the maze to guide the marble from the start to the end of the maze in as little time as possible, without letting the marble fall into any of the holes. Marble Maze adds the concept of checkpoints. If the marble falls into a hole, the game is restarted at the last checkpoint location that the marble passed over.
Marble Maze offers multiple ways for a user to interact with the game board. If you have a touch-enabled or accelerometer-enabled device, you can use those devices to move the game board. You can also use an Xbox 360 controller or a mouse to control game play.
Note
|
|---|
|
The XNA Framework also provides a sample that is named Marble Maze that runs as a Windows Phone or classic desktop Windows app. (That version does not run as a Windows Store app). For more info about the XNA Framework version of Marble Maze, see App Hub - marble maze. |
[Top]
-
Windows 8
-
Visual Studio 2012
-
C++ programming knowledge
-
Familiarity with DirectX and DirectX terminology
-
Basic knowledge of COM
[Top]
If you’re interested in creating 3-D games or other graphics-intensive applications for Windows 8, this is for you. We hope you use the principles and practices that this documentation outlines to create your own Windows Store game. A background or strong interest in C++ and DirectX programming will help you get the most out of this documentation. If you don't have experience with DirectX, you can still benefit if you have experience with similar 3-D graphics programming environments.
If you are new to game development, and your game does not have demanding graphics requirements, consider developing it as a Windows Store app by using JavaScript or XAML. For more info about these options, see Technologies for developing Windows Store games for Windows. If you want a basic introduction to Windows Store game programming with C++, see Create your first Windows Store app using DirectX. The document Walkthrough: a simple Windows Store game with DirectX describes another sample that implements a basic 3-D shooting game by using DirectX and C++.
[Top]
This documentation teaches how to:
-
Use the Windows Runtime API and DirectX to create a Windows Store game.
-
Use Direct3D and Direct2D to work with visual content such as models, textures, vertex and pixel shaders, and 2-D overlays.
-
Integrate input mechanisms such as touch, accelerometer, and the Xbox 360 controller.
-
Use XAudio2 to incorporate music and sound effects.
[Top]
This documentation does not cover the following aspects of game development. These aspects are followed by additional resources that cover them.
-
3-D game design principles.
-
C++ or DirectX programming basics.
-
How to design resources such as textures, models, or audio.
-
How to troubleshoot behavior or performance issues in your game.
-
How to prepare your game for use in other parts of the world.
-
How to certify and publish your game to the Windows Store.
Marble Maze also uses the DirectXMath library to work with 3-D geometry and perform physics calculations, such as collisions. DirectXMath is not covered in-depth in this section. For more info about DirectXMath, see DirectXMath Programming Guide. For details about how Marble Maze uses DirectXMath, refer to the source code.
Although Marble Maze provides many reusable components, it is not a complete game development framework. When we consider a Marble Maze component to be reusable in your game, we emphasize it in the documentation.
The following resources can help you understand Windows Store game development.
[Top]
We recommend that you start with Marble Maze sample fundamentals to learn about the Marble Maze structure and some of the coding and style guidelines that the Marble Maze source code follows. The following table outlines the documents in this section so that you can more easily refer to them.
[Top]
|
Title |
Description |
|---|---|
|
Provides an overview of the game structure and some of the code and style guidelines that the source code follows. |
|
|
Describes how the Marble Maze application code is structured and how the structure of a DirectX Windows Store app differs from that of a traditional desktop application. |
|
|
Describes some of the key practices to keep in mind when you work with Direct3D and Direct2D. Also describes how Marble Maze applies these practices for visual content. |
|
|
Describes how Marble Maze works with accelerometer, touch, and Xbox 360 controller devices to enable users to navigate menus and interact with the game board. Also describes some of the best practices to keep in mind when you work with input. |
|
|
Describes how Marble Maze works with audio to add music and sound effects to the game experience. |
[Top]
Note