Developing Marble Maze, a Windows Store game in C++ and DirectX

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.

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.

Introducing Marble Maze

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.

Prerequisites

Windows 8

Microsoft Visual Studio 2013

C++ programming knowledge

Familiarity with DirectX and DirectX terminology

Basic knowledge of COM

Who should read this?

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.

What this documentation does not cover

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.

Describes the steps that are required to publish a game to the Windows Store, such as how to package the game and obtain ratings certification.

Next steps

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.

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.