January 8th, 2008 by awesty


XNA Sidescroller Part 1
Welcome to the second part of three tutorials (maybe 4, depending on how lazy I am). In this tutorial we will get the player moving around the map. Collision detection. I you haven’t done part one click the link above and take the tutorial, or just download the source files (link down the bottom of part 1) and continue where we left off.
First open the solution explorer (View > Solution Explorer) and right click on your project. Go to Add > New Item…

Select Class and call it Player.cs. We will put all our player related code in here to keep everything nice and clean. Click Add and you should get a new file looking like this:
using System;
using System.
Collections.
Generic;
using System.
Text;
namespace SidescrollTutorial
{
class Player
{
}
}
Add these three using statement below the other three that are already there.
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
This just saves us from writing Microsoft.Xna.Framework before everything related to XNA. We need to add some properties and methods to the Player class. Three properties:
public Vector2 MapPosition;
public Vector2 ScreenPosition;
private Texture2D texture;
private Vector2 speed;
MapPosition is the players position relative to the top left corner of the map. ScreenPosition is the players position relative to the top left corner of the games window and texture will be the players texture. ’speed’ is the players speed (duh). And three methods
public Player
(Vector2 p
)
{
}
public void LoadContent(Texture2D t)
{
texture = t;
}
public void Update(GameTime gameTime)
{
}
public void Draw(SpriteBatch spriteBatch)
{
}
Read the rest of this entry »
January 3rd, 2008 by awesty
I’m going to try and post new screenshots every week or so of the game I am making to keep me motivated. I have almost gotten everything code wise done, all that is left is enemy AI, some levels, a few gameplay modes and possibly some more weapons… which shouldn’t take me too long (except for the AI). I am looking for someone to do some art. If you are interested email me at aengus.westhead [ @ ] gmail [ . ] com. I also need a name for the game (it was enragement, but my idea for the game has changed a lot since then).

A tower of crates. Unlike the other tiles you can push tiles around.

I broke my tower.

The only weapon so far, a bomb. At the moment they destroy all of the map pieces, but I haven’t decided yet if they should only be able to destroy tiles.
That’s it for now. It’s 1:30 and I need some sleep. -_-
January 1st, 2008 by awesty
I get a lot of people asking me about this but I don’t think it is worth making a whole tutorial for, so I am just going to write this quickly.
If you want to go to frame 2 when mc1 touches mc2 use this code:
if(mc1.hitTest(mc2.)){
gotoAndStop(2);
}
If you want to frame 9879 when the enemy has no health left use this code:
if(enemyHealth <= 0){
gotoAndStop(9879);
}
If you want to go to a new frame when a button is pressed use this code:
on (release){
gotoAndStop(someframenumber);
}
Now please stop asking me this question. I have been asked sooooooooooooooo many times.
January 1st, 2008 by awesty
Happy new year everyone! Hope you had a good night.
Filed under
News having
1 Comment »
December 26th, 2007 by awesty

This is the first of a series of tutorials that will help you make a sidescroller (like the old mario games) using XNA Game Studio. If you haven’t already install XNA Game Studio 2.0. If you are still using XNA 1.0 you will need to upgrade for this tutorial.
Open up XNA GSE and start a new project. Select “Windows Game” and give it any name you want. When you click OK ‘Game1.cs’ should be on your screen. It might look a little intimidating at first so I will explain what we will be using.
The LoadContent() function is where we will load all our graphics. The Update() function runs 60 times a second, and we will put everything that needs to be updated every frame in here. The Draw() function also runs 60 times a second and we will be drawing everything to the screen from here. Why can’t we just draw everything from the Update() function you may ask? If the game is running slowly Draw() will stop running everyframe because of that, but the Update() function will continue to run at 60fps.
Find the Game1() function and change it to this:
public Game1()
{
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
graphics.PreferredBackBufferWidth = 800;
graphics.PreferredBackBufferHeight = 608;
graphics.ApplyChanges();
}
That is just so the tiles will fit in the stage window nicely.
Before we get started we are going to need some graphics. Since this game is going to be tile based we will need a few tiles and a character. I have made three 32×32 pixel tiles. A black one for the ground, a red one that will kill the character and a yellow one that will take the character to the next level. I just made the character a 32×32 square. You can make him look better if you want but try and keep it 32×32 pixels, otherwise you will have to change some of the code. Save all those images into the Content folder of your game.
Go back into Visual Studio and open the solution explorer (View > Solution explorer). Right click on Content and select ‘Add > Existing Item’. Choose the 4 images we just made to add them to the project. Now we can start coding.
Read the rest of this entry »
December 25th, 2007 by awesty
Merry Christmas!
And I swear I will write a new tutorial soon…
Filed under
News having
No Comments »
December 16th, 2007 by awesty
It’s been a looooooooong time since I have posted anything. Mainly because I have been busy making a new game and beating guitar hero :P. I have 6 weeks off school though so I should be able to start posting tutorials again.
Just to prove that I haven’t just been procrastinating here are some screen shots for the game I am making called Enragement.
Level Editor:


Navigation around the test level:


There isn’t really much gameplay yet. I have practically finished the level editor, but all I have done in the game is some collision detection and movement. The graphics are just temporary so if someone wants to make some better ones feel free.
October 29th, 2007 by awesty

Another game I made with C# and XNA. Basically the same as the game that used to come on the old iPod’s except when you hit a block all the blocks of the same colour touching it disappear as well and it has worse collision detection.
Arrow keys to move, black blocks don’t disappear (they are obstacles). There are three levels.
To play this game you need the .NET Framework (which I recommend you download even if you aren’t gong to play the game, you will need it to run a lot of applications) and XNA runtime, which I have included in the .zip folder with the game.
Click here to download [About 1.5mb]
October 24th, 2007 by awesty
The site was down for about an hour so I could upgrade to the latest version of wordpress. The one I was using was over a year old so it was well over due
If you find something is not working properly please contact me so I can fix it.
EDIT: Okay, so I wrote that stuff above yesterday but some of the plugins weren’t 2.3 compatible and I couldn’t make any posts. Hopefully this one works…
I have also changed the sites theme, personally I think it looks better and easier to read the tutorials. Again, if you find any bugs please tell me.
Filed under
News having
3 Comments »
October 22nd, 2007 by awesty
In this tutorial you will learn some of the basics of bitmap data and how to do some cool stuff with it. I have written a tutorial for both Actionscript 2.0 and Actionscript 3.0. This will lag a lot with AS 2, so don’t make the bitmap image too big or you will crash flash (AS 3 doesn’t lag as much, but if you make the image more than 400×400 it will start to lag a lot).
Final Product:
Actionscript 2.0 version (Take this tutorial if you are using Flash 8 )
Actionscript 3.0 version (For Flash CS3 users)
Read the rest of this entry »