User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11

Thread: simulating depth in a 2D enviroment

  1. #1
    No Products Registered

    Join Date
    Oct 2006
    Location
    Uruguay
    Posts
    87
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    simulating depth in a 2D enviroment

    Hi everyone...
    I want to simulated depth in my 2D enviroment, by having the player move behind objects (or in front of). I was thinking about using the Y coordinate to calculate depth, you know? It would works something like this:
    If player.Y < obstacle1.Y then put player behind object1...
    The problem is, that I will have a lot of objects in my scene and I wanted to know if you know of a better way to do this... 'cause otherwise I will end up having a lot of conditions... you know?
    I tried using qualifiers, giving the objects the "neutral" qulifier, and then asking:

    - Is player.Y < Neutral.Y then put player behin Neutral...
    But this results in the player being behind every single "Nuetral" object.... which is not what I want...


    Can somebody give me a hand with this?
    Thanks in advance!

    - Haora

  2. #2
    No Products Registered

    Join Date
    Nov 2006
    Posts
    199
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: simulating depth in a 2D enviroment

    What kind of game are you making? If it's a platformer, I might be able to help. There's a tutorial on Sonic Fan Games HQ about parallax that may be helpful. Just go to the Tutorials link on the left, and click on the section called Special Effects and click on the Paralax tutorial (they spelled it wrong, but you'll still recognize it ). This helps make objects appear both behind, and in front of, the player (with parallax!).

  3. #3
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export Module
    DavidN's Avatar
    Join Date
    Jun 2006
    Location
    Boston, MA, USA
    Posts
    4,044
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: simulating depth in a 2D enviroment

    What the King's Quest games did (sort of side-on-ish view) was to have various "bands" that objects could be in, from the front to the back of the screen. This isn't so different from what you're doing now, but it's a matter of getting it to work with groups correctly.

    I think the Layer object has an "Order by..." condition - you could use the Y co-ordinate of your group with that and see if that helps.

  4. #4
    No Products Registered

    Join Date
    Oct 2006
    Location
    Uruguay
    Posts
    87
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: simulating depth in a 2D enviroment

    Thank you Neonotso and DavidN....
    But it's not a plataformer, it's a graphic adventure...
    What I'm trying to do, it's more like what David said... but I just don't see how to make those bands he's talking about....
    And FYI, that "Order by..." condition, only sets the initian order of the objets, if you choose "order by y-coordinate" it won't make a difference if later in-game, that coordinate changes....

    Anyone else? I would really like to do this without having 2 conditions for every single object I want to pass behind and in front of...

    Thanks in advance!!!

  5. #5
    Clicker Multimedia Fusion 2

    Join Date
    Jun 2006
    Location
    Montreal, Canada
    Posts
    234
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: simulating depth in a 2D enviroment

    From what I read, It could be like arcade fighting games as Final Fight, Double Dragon and Golden Axe.
    Characters moved left and right, but they could also move closer or away from the screen.
    If it's the case, then it's just a matter of moving up or down in Y. It's the visual environment that makes it look like the characters are moving close or away.

  6. #6
    No Products Registered

    Join Date
    Oct 2006
    Location
    Uruguay
    Posts
    87
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: simulating depth in a 2D enviroment

    Yes, but I need the main character to move behind and in front of different objects...
    THAT's what I'm asking here... how can I, based on the Y coordinate of said character, make it be behind or in front of an object...
    And don't say, "well, check for the coordinates of every object and if the main cha is higher then move it behind the object", 'cause I'm already doing that...
    I'm looking for a more generic way to do it, in case I have too many objects in my scene...

    Thanks

  7. #7
    Clicker Fusion 2.5 DeveloperHTML5 Export Module

    Join Date
    Jun 2006
    Posts
    1,465
    Mentioned
    10 Post(s)
    Tagged
    0 Thread(s)

    Re: simulating depth in a 2D enviroment

    Maybe you need to set a condition that the other objects check then if one of the object meets that condition it sends a message to the main character to change position.

  8. #8
    No Products Registered

    Join Date
    Oct 2006
    Location
    Uruguay
    Posts
    87
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: simulating depth in a 2D enviroment

    Mh, that could be a posibility.. still, there would be at least one condition per object... is there a way to group the objects and then have like 1 or 2 conditions total?

    Thanks for all the help!

  9. #9
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module
    Tiles's Avatar
    Join Date
    Jun 2006
    Posts
    1,359
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: simulating depth in a 2D enviroment

    Layer Object.

    Then give your objects to layer this code:

    Always: set Alterable Value L to Y Position.

    Layer Object-
    Always: sort by Alterable Value L, decreasing

    First line could be modified for special cases where you need them to offset a bit. Like this:

    Flag off: set Alterable Value L to Y Position
    Flag on: set Alterable Value L to Y Position minus 48

    And then your event to set Flag on or off.

  10. #10
    No Products Registered

    Join Date
    Oct 2006
    Location
    Uruguay
    Posts
    87
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: simulating depth in a 2D enviroment

    YES!, that was IT!
    Thanks so much, now I just need to get the offset right, and I'm good to go... thanks again!

    - Haora

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Simulating a mouse click?
    By Paul_Boland in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 13th November 2013, 06:48 PM
  2. Simulating the ios objects
    By trakel in forum iOS Export Module Version 2.0
    Replies: 1
    Last Post: 13th May 2013, 02:58 PM
  3. Simulating Mouse Clicks
    By Fanotherpg in forum The Games Factory 2 - Technical Support
    Replies: 3
    Last Post: 8th October 2010, 07:25 PM
  4. Having problems simulating key presses (ControlX)
    By Neonotso in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 17th July 2007, 07:17 AM
  5. Simulating a key pressed outside MMF
    By Brovic in forum Multimedia Fusion 2 - Technical Support
    Replies: 13
    Last Post: 23rd May 2007, 10:21 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
  •