This is the second part of the step-by-step tutorial for building a simple game menu in XNA. Previously we have set up the project, the game loop, and added the UI theme. Now it’s time to implement the game logic…
The latest release of the DigitalRune Engine contains a new sample called GameStatesSample which covers a some of the basics:
The result is a stripped down XNA application – no fancy graphics, no gameplay, just a few screens and menus. Take a look:
...
In the last articles (Part 1 and Part 2), we have introduced our input service and commonly used functions of the input service. In this post we will delve into more advanced functions. We will discuss how we
…
In the last post, we introduced the (still empty) input service interface. Now it is time to add a few functions. This blog post describes
XNA makes input handling very easy. It provides one static class for each input device: Keyboard, Mouse, and GamePad. In each frame, you can query the device states and examine the current key and button states. But sooner or later you discover that there are a few tasks that are not supported:
This becomes especially apparent when you create a game with a complex user interface (windows, text boxes, etc.).
And to be clear: It is ok that these tasks are not supported because the XNA Framework is not a game engine!
While creating our XNA GUI library (see DigitalRune Game UI), we have identified several commonly needed tasks and packed them into an input service. This and the next blog posts describe our input service design.
A collection of the most useful blog articles can be found here:
Article Collection (on Documentation page)
DigitalRune is a trademark of Garstenauer Information Technology OG.
Garstenauer Information Technology OG Weingartenstrasse 35, 4452 Ternberg Austria (EUROPE) office@digitalrune.com