XNA Creators Club Online
Page 1 of 1 (10 items)
Sort Posts: Previous Next

2D tiled level sample

Last post 2/18/2008 3:03 PM by David Johnston. 9 replies.
  • 7/10/2007 5:59 AM

    2D tiled level sample

    I've seen quite a few posts now with people asking for help on 2D tile maps and collision detection for a character jumping around so I thought I'd put together a sample.  It's hopefully fairly simple but I thought I'd get people's opinion on it before officially putting it on my website.

    TiledLevel sample

    It consists of an .html file describing the key bits of the source (drawing the tiled map and collision detection with the map) and a complete .sln which builds for Windows.

    If it seems useful I might add more but this seems like the most basic fundamentals to getting such a game running and I don't want to confuse people with code they might not be interested in.

    Cheers,

        Dave J

     

     

    http://www.smudgedcat.com
  • 7/10/2007 1:02 PM In reply to

    Re: 2D tiled level sample

    Hey, Dave, I think it looks really good.  I wouldn't add much more to it -- I think you're right that it's best to keep it to the basics.  I found it very easy to look through and understand.  My only disappointment was that there was no princess at the top!  ;-)

    Tom

     

  • 7/10/2007 7:57 PM In reply to

    Re: 2D tiled level sample

    Looks great to me. A lot that I can learn from that code, very well commented and I love your use of whitespace. Thanks for putting the extra effort in to make your code so human readable. Much appreciated.

    I'm really looking forward to digging into this further and picking up some of the techniques you demonstrated.

    Great job!
  • 7/11/2007 4:33 AM In reply to

    Re: 2D tiled level sample

    Thanks for the comments folks, I've got a proper link to the tutorial on my website now.

    Cheeers,

        Dave J

    http://www.smudgedcat.com
  • 7/11/2007 6:11 AM In reply to

    Re: 2D tiled level sample

    Thank you so much for taking the time to do this. I love platform games and having a core framework like this to reference really means I can get on with trying my ideas out instead of spending weeks or months writing the engine.

    Cheers - I owe you a beer.

  • 7/11/2007 6:32 AM In reply to

    Re: 2D tiled level sample

    the last platform is impossible to get to.

    god.
  • 7/11/2007 8:29 AM In reply to

    Re: 2D tiled level sample

    Kawe:
    the last platform is impossible to get to.

    god.

    The map is actually randomly generated to keep the code simple.  It's possible you can start completely wedged between two platforms as well.  Just run it again.

    Cheers,

        Dave J

     

    http://www.smudgedcat.com
  • 7/12/2007 7:19 PM In reply to

    Re: 2D tiled level sample

    Oh, since it was a "tiled LEVEL sample" I assumed it was actually loading the level from a file. But I guess randomly generated level sfits into "level" too. heh.

    right right.

    hmm, but... I think it'd be nicer if it loaded from a file.. as an example that is.
    one of the more difficult aspects for a beginner isn't XNA code. it's getting things that aren't XNA to work with XNA.

    just my opinion :) the sample is good as is.
  • 7/12/2007 9:18 PM In reply to

    Re: 2D tiled level sample

    Nice. I will definitely be making use of this. Especially the camera's movement. It was very fluid.
  • 2/18/2008 3:03 PM In reply to

    Re: 2D tiled level sample

    I've just added a second part to the Tiled Level tutorial on my website.  It adds coins which the player can collect and blobs which will hurt the player, it also covers managing all these objects in the level.  I've still tried to keep everything as basic as possible and show how the core mechanics work.  As you can tell by the graphics used it's not particularly flashy! :)

    Tiled Level tutorial

    If anyone has any suggestions about what they'd like to see added to these tutorials you can drop an email to info@smudgedcat.com.

    Cheers,

        Dave J

     

    http://www.smudgedcat.com
Page 1 of 1 (10 items) Previous Next