Tiled level tutorial
Part 1
This sample contains a complete .sln for Windows
and .html help for a simplistic 2D platform game.
The source is taken from Shuggy so you may find
the movement of the character quite familiar. I've
tried to keep the source code as simple as possible
and have only covered the very basics of
implementing this style of game. Hopefully it gives
a good starting block to creating your own game.
The source and associated help files cover:
•
Rendering a tiled background - You'll find out
how to render only the tiles which are on screen and render them in the right place to
produce a smooth scrolling movement when the player character moves.
•
Player movement - The tutorial shows what needs to be stored to represent a jumping
playable character, how controller input affects the player and implementing gravity.
•
Collision detection and response - You'll see how to check an object's movement against the
map and stop the object at the appropriate position if it has collided with a wall.
Download here (code is based on XNA framework version 3.1)
Feel free to use this source as a basis for your own game or cut and paste the bits you're interested
in to your own project.
Part 2
The second part of this sample builds on the first by
implementing a better system for dealing with many
objects in a level and adds two new types of object,
coins and blobs. Coins are stationary and can be
collected by the player whereas blobs move back
and forth jumping occasionally and will hurt the
player.
Download here (code is based on XNA framework
version 3.1)
Feel free to use this source as a basis for your own
game or cut and paste the bits you're interested in to your own project.
Contact:
General information
info@smudgedcat.com
Product support
support@smudgedcat.com
Forums
Blog