dcsimg
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: 2D Tilebased Depthsorting

  1. #1
    Junior Member
    Join Date
    Jun 2010
    Posts
    1

    2D Tilebased Depthsorting

    Hi!

    I need a little help understanding depth sorting in AS2 from a 2D (Zelda-like) perspective. Well, I suppose it is 3D, but I mean, top down rather than isometric.

    From what I understand each tile movieclip attached must be on a different depth. So should I be using _root.getNextHighestDepth();? Although, the problem is not making the tiles appear in proper order, it has to do more with the character movement.

    At which point do I actually swap the depths of the character, and do I swap it with the surrounding tile's depths, or do I give it another depth completely.


    I don't think it should be too complicated, I just need some guidance. Thanks!



    By the way, my inspiration to learn sorting was from a newly uploaded game on Kongregate called The Enchanted Cave. As you can see, it's very simplistic and that's what I'm aiming for, in terms of sorting.

    And no, I'm not recreating it!
    Last edited by randomuser; 06-08-2010 at 06:03 PM.

  2. #2
    Senior Member fil_razorback's Avatar
    Join Date
    Jul 2005
    Location
    Paris, France
    Posts
    607
    I think what you should do is use one movie clip per tile row on your map and give these a depth equal to m*i where i is the row number (from top to bottom) and m is the maximum number of characters on your map.
    Then you have to find what row your characters are standing on and give each of them a depth between m*i and m*(i+1).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center