Added: 6 months ago
From: NayusDante
Views: 222
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:

All Comments (10)

Sign In or Sign Up now to post a comment!
  • Is there by any chance a possibility for you to make a tutorial on how you can make collision in xTile like that?

    I've been trying to learn XNA and xTile and I always get stuck on the collision part.

    I would be grateful if you did. :D

  • @Jurgen5586 You need to use tile attributes. I set attributes for BlockedNorth, BlockedSouth, etc and check them when the player is moving. If the player is about to move north, the game checks if the tile one north of the player's position has a BlockedSouth property. I do the properties on the tileset, so you check the map's layer's tile's TileIndex. If the player is at (4, 3), you check if Map.Layer[int layerumber].Tile[4, 2].TileIndex.ContainsProperty(­BlockedSouth) == true.

  • @FactoryEight Yeah.. About that.. To be honest that didn't make much sense to me. If it does not take too much time, could you write me a simple guide or make a video? :)

  • @Jurgen5586 Give your player object a CheckForCollisions function that returns a boolean. If it returns false, let the character move. In the function, you need to determine what tile the character is standing on, and check the properties of the tile that they'd be on if they were to move. Just play around with the xTile functions and get an idea of what properties there are in a map that you can check. There's also some good code snippets on the tIDE forums to explain Tile/TileIndex properties.

  • @FactoryEight After a little bit of fiddling I found out a way that worked like a charm. Thanks! :D:D

  • Comment removed

  • teh old final fantasys

  • What are they supposed to be, monkeys? Cavemen? Nudists?

  • @theotherther1 Ignore the art, those are just placeholder sprites. That's a sprite template from OpenGameArt, and won't be final art in whatever I end up making. Right now, focus is on the engine itself.

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more