I require a basic XNA 2.0 (ie Visual Studio 2005) project which shows how you to create a 2D scrolling map created out of a grid of tiles. Both horizontal and vertical scrolling is required.
Basic player position should also be included, which the keyboard can be used to move within the constraints of the grid. The map should automatically scroll when the player approaches the edge of the view port.
## Deliverables
I'd like a basic framework of a 2D tile game using the XNA Framework 2.0 (I'm using Visual Studio 2005 so need it in 2 rather than 3 which requires 2008).
?
?
The requirements are:
?
* To have a 2D grid of tiles which is larger than the available display space.
* The number of columns and rows should be able to be specified
* The width and height of cells should also be able to be specified. All cells will use the same width and height.
* Each tile should be drawn using a basic asset. I don't need graphics so simple colour blocks are fine.
* A single sprite representing a player should be defined. Again, a simple colour block is sufficiant.
* Using the cursor keys will move the player sprite around the grid and redrawing should automatically take place. It would be helpful if only the areas that need redrawing (ie the current cell and the new position) are drawn.
* If the player sprite approaches the edges of the visible area, the grid should automatically scroll so that the new tiles are visible and the player character is still on screen.
* It must be possible to scroll horizontally and vertically, and in all four directions.
* Each tile should also have a corrosponding tile object which contains details on if the tile is solid or empty space, and drawn accordingly.
* If a tile is marked as solid, it should not be possible to move onto it.
* The code should be object orientated, so I would assume that the tile engine would be a class, another class for describing a tile, possibly another class for input handling, allowing for extensibility and easy reuse.
?
Optionally, it would be nice if:
* A grid was overlayed on top of the tiles
* It was possible to overlay additional sprites or assets on top of a cell.
* As this project is to help me learn DirectX and game programming, properly constructed and documented code would be much appretiated.
?
The goal of this project is to help me get a head start on game programming using DirectX and the XNA Framework 2.0. It's likely that after I have got to grips with this code there will be additional bid requests on more advanced topics such as animation, navigation screens or even AI.