XNA Game Programming Adventures
Tutorials
Welcome to my the XNA Tutorials page on my site XNA Game Programming Advenutres. I
will be writing other tutorials on game programming with XNA
that do not have to do with my role playing game tutorials. I will be posting
those tutorials on this page.
Simple Tile Engine
Space Raptor
Begginer XNA Break Out Tutorials
These beginner XNA tutorials on creating a Break Out style game. They go into the basics of the game and are not meant to be a full game. The advanced XNA Break Out tutorials will be a complete XNA game with more features found in an XNA game.Part 1 - The Paddle and the Ball
This is the first tutorial in my XNA Break Out beginner tutorial series. It covers getting the paddle on the screen and being controlled by the player. It also covers adding in the ball and having it bounce around the screen.
Breaking Out Tutorial 1
Breaking Out Tutorial 1 - Zipped
XNA Tile Engine Tutorials
These tutorials are the tutorials in my simple XNA tile engine tutorial series. They are meant to introduce how to make a basic tile engine with XNA.Part 1 - Simple Tile Engine
This is the first part in a simple XNA tile engine tutorial series. In this tutorial I cover the basics of tiling. What tiling is and one way you can do tiling with XNA. Tile engines are used for many different types of games including platformers, role playing games, and strategy games.
Tile Engine Tutorial 1
Tile Engine Tutorial 1 - Zipped
Part 2 - Scrolling the Map
In this second tile engine tutorial I cover the basics of scrolling a tile map in just one direction at time and only in cardinal directions, up, down, left, and right. I introduce the idea of using a camera to control the scrolling of the map. In a future tutorial I will cover adding a camera class to the tile engine.
Tile Engine Tutorial 2
Tile Engine Tutorial 2 - Zipped
Part 3 - Adding a Camera Class
In this tutorial I added in a 2D camera class to work with the tile engine to control the scrolling. On reason for using a camera class is that if you are developing a split screen game you can use the class instead of having a lot of variables and duplicating code. I also cover scrolling the map at the same speed in all directions.
Tile Engine Tutorial 3
Tile Engine Tutorial 3 - Zipped
Part 4 - Increasing Efficiency
At the moment the tile engine is a little inefficient. In this tutorial I will make it a little more efficient. Two things that are inefficient is that the tile engine is drawing all tiles, even if they are not on the screen. Another thing is that each time through the nested loops that draws the tiles I was creating a Rectangle object. That takes time and uses resources. It is much better if you do that just the once at the start of the drawing code.
Tile Engine Tutorial 4
Tile Engine Tutorial 4 - Zipped
You can find the latest version of the Tile Engine at this link.
Tile Engine Source Code
Collision Detection Tutorials
These tutorials will get you started with collision detecteion in your games. As they progress they will introduce more and more concepts in collision detection. They will be introduced in simple games where each type of collision detection is used.Bounding Box Collision Detection
The simplest form of collision detection is bounding boxes. You make a bounding box, rectangle, around the each object in the game and if they intersect then the objects collide. I introduce this type of collision in the game of Pong played by two players.
Bounding Box Collision Detection
Bounding Box Collision Detection - Zipped
XNA Screeen Management Tutorials
These tutorials will get you started on handling screen management with your game. When games get larger with many screens they can become hard to manage. If you start out with a screen management system to begin with you will be able to better organize your code and your game will be easier to manage.Part 1 - Creating the Menu
To get started with a screen management system I decided to start out making a menu component. One reason is that menus are a common part of games they control the flow of the game, at least partially, between game states.
XNA Screen Management Tutorial 1
XNA Screen Management Tutorial 1 - Zipped
Part 2 - Creating Game Screens
With the menu component it is now easy to navigate between the screens of the game. In this tutorial I cover adding in different screens for a game. I start with a main menu or start screen. From the menu you can start the game or move to the game screen. There is no game and the screens have different background images. This is just to introduce the concept of managing the state of the game using different game screens.
XNA Screen Management Tutorial 2
XNA Screen Management Tutorial 2 - Zipped
Part 2A - Adding in Music
Quite often you want different music in the different screens of your game. This tutorial was written to show one way that you can add that functionality into your games with the screen manager that I use. I wrote it to take place after the second tutorial but could easily be extended to take place after the other screen manager tutorials. This one is specific to XNA 3.1 and will not work with XNA 3.0 because of changes made between XNA 3.0 and XNA 3.1. I am looking into writing another one that will work with XNA 3.0. This tutorial does not use XACT. Instead it uses the SoundEffect and SoundEffectInstance classes. I will write one using XACT as well.
XNA Screen Management Tutorial 2A
XNA Screen Management Tutorial 2A - Zipped
Part 3 - Xbox 360 Game Pad Support
The screen managment tutorials so far worked with the keyboard. For games on the Xbox 360 you should have suppport for the Xbox 360 game pad. In this additional tutorial I cover add in support for the Xbox 360 game pad.
XNA Screen Management Tutorial 3
XNA Screen Management Tutorial 3 - Zipped
Part 4 - Creating Pop Up Screens
A common task when you are making games is to have a little pop up screen to ask for action to be taken. You don't want to cover the entire screen but you want the game to stop updating until the action has been confirmed. In this bonus tutorial I cover creating a pop up screen that will keep the game from updating but still render. There are techniques you can use to grey out the screen and other effects with XNA that I don't go into in this tutorial.
XNA Screen Management Tutorial 4
XNA Screen Management Tutorial 4 - Zipped
I will also be working on other shorter tutorials that I think might be helpful as well as tutorial series on different types of games.
Good luck with your XNA game programming adventures.
Jamie McMahon
