Tag Archives: xna

Detecting keyboard input in XNA

Keyboard input is essential in most games. The user might use it for moving a character, mario style enemy killing and many other things. XNA supports so called keyboard states to detect keyboard input.

Posted in C# | Also tagged , , , , , , , , , | Leave a comment

Creating the World, View and Projection matrices in XNA

The World, Projection and View matrices are used in XNA to project your 3D world on your 2D computer screen. The theory behind 3D projection can be found here.

Posted in C# | Also tagged , , , , , , , , , , , , | Leave a comment

Generating a random color in C#

Always wanted to have your own random color generator in C#? This snippet shows you how to do it.

Posted in C# | Also tagged , , , , , , , , | 1 Comment

Framerate GameComponent to calculate the frame rate (XNA Framework)

Microsoft XNA can be used to develop computer games. This code snippet contains a so called GameComponent written in C#. The GameComponent is called Framerate and it simply calculates the frame rate of the game at each Update cycle.

Posted in C# | Also tagged , , , , , , , | Leave a comment