Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / Languages / VB

Use the XNA Framework in Visual Basic .NET

2.60/5 (4 votes)
20 Feb 2008CPOL2 min read 1   735  
This is a VB.NET project template, using the XNA framework.

Introduction

When it comes to game development, the XNA framework is an invaluable tool to use. It greatly simplifies the code that is used to create powerful, feature rich games. But, if you have ever tried to use the XNA framework in VB.NET, you quickly found out that it doesn't work. Maybe in the future Microsoft will support VB.NET, but for now XNA only supports C#. Since a quick search of this site didn't reveal any XNA code or templates for VB.NET, I decided to write this template to help those who would like to use the XNA framework in VB.NET.

Using the Code

To use this template, simply download the .zip file and place it in your Visual Basic .NET project templates folder. The path to this folder should be something like this: "C:\Documents and Settings\UserName\My Documents\Visual Studio 2005\Templates\ProjectTemplates" or "C:\Documents and Settings\UserName\My Documents\Visual Studio 2005\Templates\ProjectTemplates\Visual Basic". Either folder will work.

NOTE: In order to use this template, you must have the XNA framework installed. There are numerous places to get it. If you don't have it, a quick Google search for "XNA framework" will bring up many sites where you can get it. Also, this is not a complete game, nor is it meant to be. This template only creates the starting point for you to build upon. All code is fully commented to show what each procedure is for.

Limitations

The only downfall with using XNA in VB.NET is that you won't be able to develop XBox 360 games. Your games will only work on Windows, because as of yet, the XBox 360 console doesn't support the Microsoft.VisualBasic.dll required to use the VB.NET language. Hopefully in the future this will change.

Tutorials

For those of you who would like to learn to use the XNA framework in VB.NET, if time lets me, I am going to try to write several tutorials on doing this in my spare time. I will try to keep them simple, with plenty of comments and explanations of what is going on. Although these tutorials will be aimed at the beginner in XNA, you should have some programming experience to make full use of them, because I am not going into the Visual Basic language syntax. Anyways, keep checking back.

History

  • 20th February, 2008: Initial post

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)