Take a Look at the 4th XNA Tile Engine Tutorial!
The XNA Game Studio Express may still be in beta phase, but that sure isn’t stopping people from checking it out. And thank goodness we have people who go ahead and test the waters, because we get free XNA tutorials (yippee)!
Kurt Jaegers is one of those guys, and he has been giving out some XNA tile engine how-to’s for quite some time already. You’ve probably followed it really closely, so we’re going to breeze through the rest and head on to part 4, the latest in the series.
Wait, you haven’t yet? We’ll give you a really quick lowdown. Basically, this guide is on simple tile-based map engine creation, so if you’re wondering how to create character sprites and avatars, then this one isn’t for you. Now that it’s clarified, go whip out your XNA Game Studio Express Beta and create a new project, and give it a name. According to Jaegers, the code contains three methods:
- Game1 – Named the same as the class, this is the class’ constructor. In the project template it contains a single line (InitializeComponent();)
- Update – This routine is run in a continuous loop and is intended to be the place where your game logic is run. Here you can accept player input, update locations of game objects, etc
- Draw – Finally, the Draw method is responsible to rendering the current game state to the screen. It is called by the class as rapidly as the system can handle.
After that, get the tiles that you’re going to use for the screen. You can use texture images available online, or make them yourself. When you’re done, add the resources that you need in the game, then declare variables.
Okay, since we’re going over the previous tutorials really quickly, we’re missing quite a lot of details. To get the whole thing, go check out our source for the previous tutorials. Now that it’s out of the way, we can get to the blow by blow account of Kurt’s fourth tutorial. The fourth tutorial is about creating a simple map editor for loading and saving maps, instead of keeping all of the map code in the game code itself.
Kurt says that you’ll learn a couple of new stuff in this part, such as using the mouse pointer to select and edit maps as well as paint tiles; loading and saving streams, as well as tracking a program state.
To toggle between “Play Mode” and “Edit Mode,” press E. In “Edit Mode,” Kurt says that you guys have to add a box to the lower portion of the screen that displays which tile are you currently painting, and three buttons so that you can choose any layer that you’re currently working on. The “W,” “A,” “S,” and “D” keys will be used for scrolling the tileset for current drawing title selection, while arrow keys will be used to move around the map.
And that’s a wrap, folks. To access the whole thing, click on “Read.” Do keep yourselves creative, and who knows, maybe we’ll get to feature your Xbox 360 homebrew game in the near future!
The XNA Game Studio Express may still be in beta phase, but that sure isn’t stopping people from checking it out. And thank goodness we have people who go ahead and test the waters, because we get free XNA tutorials (yippee)!
Kurt Jaegers is one of those guys, and he has been giving out some XNA tile engine how-to’s for quite some time already. You’ve probably followed it really closely, so we’re going to breeze through the rest and head on to part 4, the latest in the series.
Wait, you haven’t yet? We’ll give you a really quick lowdown. Basically, this guide is on simple tile-based map engine creation, so if you’re wondering how to create character sprites and avatars, then this one isn’t for you. Now that it’s clarified, go whip out your XNA Game Studio Express Beta and create a new project, and give it a name. According to Jaegers, the code contains three methods:
- Game1 – Named the same as the class, this is the class’ constructor. In the project template it contains a single line (InitializeComponent();)
- Update – This routine is run in a continuous loop and is intended to be the place where your game logic is run. Here you can accept player input, update locations of game objects, etc
- Draw – Finally, the Draw method is responsible to rendering the current game state to the screen. It is called by the class as rapidly as the system can handle.
After that, get the tiles that you’re going to use for the screen. You can use texture images available online, or make them yourself. When you’re done, add the resources that you need in the game, then declare variables.
Okay, since we’re going over the previous tutorials really quickly, we’re missing quite a lot of details. To get the whole thing, go check out our source for the previous tutorials. Now that it’s out of the way, we can get to the blow by blow account of Kurt’s fourth tutorial. The fourth tutorial is about creating a simple map editor for loading and saving maps, instead of keeping all of the map code in the game code itself.
Kurt says that you’ll learn a couple of new stuff in this part, such as using the mouse pointer to select and edit maps as well as paint tiles; loading and saving streams, as well as tracking a program state.
To toggle between “Play Mode” and “Edit Mode,” press E. In “Edit Mode,” Kurt says that you guys have to add a box to the lower portion of the screen that displays which tile are you currently painting, and three buttons so that you can choose any layer that you’re currently working on. The “W,” “A,” “S,” and “D” keys will be used for scrolling the tileset for current drawing title selection, while arrow keys will be used to move around the map.
And that’s a wrap, folks. To access the whole thing, click on “Read.” Do keep yourselves creative, and who knows, maybe we’ll get to feature your Xbox 360 homebrew game in the near future!