User Tag List

Results 1 to 3 of 3

Thread: Key press order, direction problem...

  1. #1
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export Module
    Konidias's Avatar
    Join Date
    Aug 2009
    Posts
    1,546
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Key press order, direction problem...

    Is there any way to get proper directions with movement while holding two keys? For example, if you have the following events in this order:

    keypressing left
    keypressing right
    keypressing down
    keypressing up

    and then you move around... if you press and hold up or down and the press left or right, you get a nice strafing. (what I want) because the up and down keypressing is being checked after the left and right.

    but if you try to move left or right and then press up or down, you turn to face up or down.

    I know this is due to the order of the conditions in MMF. If you put up and down checks over top of the left and right, the situation is reversed.

    Is there any way to have it either always face in the direction of the last key pressed, or always face in the direction of the first key pressed?

    Setting flags on and off really doesn't help, considering they still go in some sort of order.

  2. #2
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export Module
    Konidias's Avatar
    Join Date
    Aug 2009
    Posts
    1,546
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Re: Key press order, direction problem...

    No solution for this then?

  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: Key press order, direction problem...

    You would need a separate object to store the first key pressed in a particular... cluster of keys (is the term coming to mind just now).

    If none of the keys are pressed (Repeat while "Up" is not pressed + Repeat while "Right" is not pressed... etc) then set a value/direction to some sort of value you can check for. (Call it an alterable value - set it to -1 when none of the keys are being pressed).

    Then, as soon as any of the keys that you want to check for are pressed (Repeat while (key) pressed + Object's value is -1), set that object's value to indicate that that particular key was pressed first. Even with any other keys pressed, that object's value will remain at the value for the first key until all the detected keys are released again.

    Use that stored value to decide which way the character should face.

Similar Threads

  1. Order problem
    By Outcast in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 24th July 2012, 04:24 AM
  2. Order of operations problem
    By mobichan in forum File Archive
    Replies: 3
    Last Post: 6th August 2010, 03:18 PM
  3. Problem With Order of Subapplication/buttons
    By Xilodragon1 in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 1st June 2009, 05:35 PM
  4. Annoying problem with order.
    By camelman in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 17th September 2008, 05:37 AM
  5. Direction Problem
    By Random_Poster in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 10th July 2006, 02:13 AM

Posting Permissions

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