User Tag List

Results 1 to 4 of 4

Thread: Trouble with detecting keys - Custom 8 direction movement

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Apr 2007
    Location
    Australia
    Posts
    1,151
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Trouble with detecting keys - Custom 8 direction movement

    I'm currently creating a custom 8 direction movement with acceleration and deceleration.

    It's all working fine, except for a weird annoyance. Moving diagonally works most of the time, but on some occasions when pressing two keys at once and letting them go after half a second it will still think that one of the keys is being pressed. It's almost like there is a small amount of input detection lag.

    It does the same thing if I use the basic Clickteam 8 direction movement.

    I thought it might be my keyboard, but I tested it in The Binding of Isaac Rebirth (has 8 direction movement as well) and there is no issue with this weird input lag and the player continues in the diagonal direction no matter how short the key press combinations are..

    Let me know if it's doing the same thing for you in the example below. To get it doing weird things, press either left and up, left and down or right and up or right and down pretty rapidly. You should notice that the deceleration continues diagonally most of the time, but on occasions, will straighten out to a cardinal direction.
    Attached files Attached files

  2. #2
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export Module
    aenever's Avatar
    Join Date
    Jun 2013
    Posts
    1,439
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    It looks odd yet it makes sense, your code is just implementing the last key stroke. As you release the two keys sometimes the user will inadvertently let go of the keys with a split second difference. Sometimes the key strokes are released at exactly the same time and the direction decelerates in the correct direction. What ever key stroke or key strokes are recognised last, it will decelerate in that direction.

    My advice if you want to correct it, is you'll probably have to set up a condition that if there are no key strokes registered set the speed to zero (i.e. no gradual deceleration).

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Apr 2007
    Location
    Australia
    Posts
    1,151
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmm, I wonder if there is a way to prevent it from always polling for current keystrokes right after one or more have been released.

  4. #4
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    mobichan's Avatar
    Join Date
    Oct 2007
    Location
    Buffalo, NY
    Posts
    3,283
    Mentioned
    26 Post(s)
    Tagged
    0 Thread(s)
    Maybe set a variable to a directional value (0 = neutral, 1 through 8 = direction held) and have event conditions that check the value? This way you would be moving the player based on the value, NOT the actual key being pressed. You could also try using flags.

Similar Threads

  1. Trouble with DavidN's Fastloop Custom Platform Movement
    By TheFieryPlumber in forum Multimedia Fusion 2 - Technical Support
    Replies: 15
    Last Post: 27th June 2014, 02:04 PM
  2. WASD Custom Keys - Movement
    By Sparckman in forum Guides, Tutorials, Examples, Widgets
    Replies: 0
    Last Post: 24th June 2014, 07:53 PM
  3. Use A, W, S, D Keys For Eight Direction Movement
    By drnebula in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 5th June 2010, 12:24 AM
  4. Possible to remap direction movement to new keys?
    By SUNCHIRP in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 31st March 2009, 11:21 PM
  5. Custom 8 Direction Movement
    By JL32BiT in forum File Archive
    Replies: 1
    Last Post: 2nd July 2006, 07:08 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
  •