Posts Tagged ‘C#’

8WeekGame – Competition 2 – Details

I havent talked about this for a while. The first competition was a roaring success in terms of what was achieved – ie 3 Games made in 8 weeks. Shawson did a blinder in Javascript using some of the new HTML5 Canvas elements, and ManicSpaceman won the competition, which was well deserved.

Now the 2nd competition will begin on 04/10/10, but this time the brief is simply:

  • 2D side scroll
  • 1 playable level
  • Cannot use pre-made libraries (Apart from standard ones line XNA)

Shawson has decided this time to use C# XNA due to winning a competition, where he won a MSDN Ultimate subscription worth £13,000! Well done Shaw!

I have already thought about the type of game i want to do, which will be a space side scroll, with space ships, aliens etc. This time round i will design the game properly before coding so that i know what im doing before the competition starts. The rules state we cannot begin coding the game until 04/10, but we can design!

Martin has decided to do a Double Dragon clone, and Shawson is toying with Cannon Fodder, so a diverse selection!
Anyway i will blog more info when i have it.

Info – Game Programming Terminology – Part 2

**This post follows on from Info – Game Programming Terminology – Part 1.

As per my previous post, the following are terms which you may find useful, again these are inspired by my knowledge and Chad Carters excellent book, XNA Game Studio 3.0 – Unleashed.


Effects are quite simply used to get any 3D object to be shown on the screen, with effects like:

  • Textures
  • Light
  • Position of Points

One of the XNA classes to use is BasicEffect which will have one or more technique, and a technique will have one or more passes.

NB: More info to come on the explanation on technique and pass.

Index Buffers:

As we mentioned in the previous post, vertices are stored in Vertex Buffers, which is an area in memory containing lists of vertices. So an index buffer is an area in memory that stores indices that correspond to our Vertex Buffer.

For e.g. if you wanted to draw triangle, you use 3 points (x,y and z if needed) in the vertex buffer, i.e 3 x Vectors (x,y,z). If you want to draw a Rectangle (2 triangles), you could use 6 Vertices in the Vertex Buffer. But because the vertex structs in XNA are memory intensive, AND some of the vertices would be duplicated, then you only need to use 4 in the Vertex Buffer.

The Index Buffer will store 6 indices that correspond to the vertices, in the order we want them rendered. This means only the indices are duplicated and not the complex vertex data.

Good example of this is explained here.

Info – Game Programming Terminology – Part 1

I have started doing Chad Carters book, XNA Game Studio 3.0 – Unleashed, and im now on Chapter 4, Creating 3D Objects. Chad writes the book in a very unique way, where he starts with 3D Game logic first before 2D. You may think this is silly, but it is helping me solidify my current knowledge of 2D XNA programming, and making me delve into 3D, way before i would of without this book (maybe never). So hats of to Chad because i think it is actually the way to do things.

On reading i up some new terminology (to me anyways), which i will share with you now, plus some that i already knew, but the newbies of the gaming world may not know:


This is an important part of 3D and 2D gaming. All game objects are represented by points in space as a Vector. These are x, y and z coordinates (Cartesian).

Within XNA there are various Vector structs:

Vector2 (X,Y)


Vertex Buffers:

The 3D objects we talked about are made up of triangles. This is because the Graphics cards are designed to use triangles as the basic primitive. For e.g. a rectangle is made up of 2 triangles. A triangle in 3D space is 3 vertices.

Vertex buffers are used to store the 3D points in memory. XNA uses the coordinate system by:

x = goes from left to right  – e.g. left = -1 right = 1 (Horizontal axis)

y = goes up and down – e.g. down=-1 up = 1 (Vertical axis)

z = goes forward and back – forward=-1 back=1 (Depth axis)

A lot of 3D geometry going on here, but as Chad says in his book, even though XNA does a lot for you, it is good to know the math behind it.

Tutorial – How To Start a New XNA Project

Again, this is aimed at beginners who have just started using Visual Studio 2008. To start a new project:

XP Users:

  1. Use the mouse and hit Start icon in the left hand side.
  2. Navigate through All Programs->Microsoft Games Studio <Version number>Microsoft Visual Studio 2008
  3. This will start Visual Studio IDE. Now to start a new Project navigate either:i) If VS2008 takes you to the Start Page tab (With the MSDN RSS Feeds etc), on thre top left hand  square  will will a square with clickable links:

ii) Or you can navigate by using File->New-Project and selecting one of the required XNA templates (Which should be under C#)

Tutorial – Installing XNA Games Studio

This ia quite an easy one really. You will need the following to begin coding XNA games:

  1. A PC (!)
  2. Visual Studio Express/Professional/Team Edition. If you want to code for Windows 7 Modile, you will need the 2010 edition.
  3. XNA Games Studio 3.1 or 4.0 (Only beta version is available at time of writing) for Windows 7 Mobile.
  4. You can sign up for the Creators Club website for free. If you want to install games on your Xbox you will need to pay a 4monthly fee of £39.99 or £60.00 for annual.

Then all installed and ready to go. There are requirements for Graphics Cards and shader models, but all modern cards should be ok for your needs.

The hardware requirements are though from Microsofts website:

“Hardware requirements are identical to those for Visual Studio 2008, plus a graphics card that supports DirectX 9.0c and Shader Model 1.1 (Shader Model 2.0 is recommended and required for some Starter Kits). Zune development requires the Zune 3.0 firmware.