User Tag List

Results 1 to 6 of 6

Thread: dynamic order

  1. #1
    No Products Registered

    Join Date
    Dec 2006
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    dynamic order

    So I was trying to figure out a way of getting my player character to appear in front of background objects at one point and behind them at other points.

    I am "trying" to make a top down game. (A similar POV as the Zelda games)

    I came up with this method, which only works on a single object.

    - red block is my player and the hitbox (invisible)
    - That group is the "background objects" group
    - the last object is the actual player sprite which is attached to the red square.

    This method works well, but unfortunately only on a single instance of background objects.

    I guess I would need a further condition if I were to use the above system, so that MMF looks for the closest object to the player and either puts them in front or behind them?
    How would I go about MMF checking which the closest object is the to player?

    Is there a better way to approach this problem than the path I am taking?

  2. #2
    No Products Registered

    Join Date
    Oct 2006
    Location
    Sweden
    Posts
    1,141
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: dynamic order

    The Layer Object has an automatic sort function for this kind of thing.

  3. #3
    No Products Registered

    Join Date
    Dec 2006
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: dynamic order

    Could you expand on that please?
    I don't have much experience with layers and this specific problem.

    My main problem is getting MMF to know when to send a background object above and when it needs to send it below.

    Never mind, figured it out.
    Thanks for pointing me to the layer object though.
    Ahh, just read the post below this one, interesting info
    Thanks for that, it's very helpful.

  4. #4
    No Products Registered

    Join Date
    Oct 2006
    Location
    Sweden
    Posts
    1,141
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: dynamic order

    There is an extension called Layer Object, it has an action Sort > By Y (Increasing)
    It will sort all objects on the screen according to their Y Position.

  5. #5
    No Products Registered

    Join Date
    Dec 2006
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: dynamic order

    First up, thanks for your help thus far.


    So I set: always decreasing Y sort.

    That works pretty well for most BKG objects, but I also have some objects that need to be in the same layer as the player sprite and always need to be under the player sprite.
    Is there a way to exclude objects from the sort procedure?

  6. #6
    No Products Registered

    Join Date
    Oct 2006
    Location
    Sweden
    Posts
    1,141
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: dynamic order

    Try manually updating those objects using "move object behind object" after the main sorting.

Similar Threads

  1. HWA Dynamic Light Example
    By Werbad in forum File Archive
    Replies: 14
    Last Post: 17th January 2009, 09:05 AM
  2. Dynamic data help.
    By SEELE in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 13th May 2008, 01:44 AM
  3. Dynamic properties
    By z33z in forum Extension Developers Lobby
    Replies: 3
    Last Post: 28th April 2008, 12:34 PM
  4. Dynamic arrays
    By stAtrill in forum The Games Factory 2 - Technical Support
    Replies: 5
    Last Post: 14th September 2007, 02:42 PM

Posting Permissions

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