User Tag List

Results 1 to 5 of 5

Thread: Wall jump bug that is hard to fix.

  1. #1
    No Products Registered

    Join Date
    Jul 2013
    Location
    -The Internet-
    Posts
    62
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Wall jump bug that is hard to fix.

    Hi guys this is a very important request. The problem this time is that in my engine i created a wall jump function which works but with one stupid problem which i tried countless times to resolve, that problem is that when i wall jump the jump works fine but if i wall jump and my character is in the air, there is some kind of gravitational pull that keeps making him go left and he wont stop unless i do a wall slide. Sorry if its hard to explain, here is my engine since its easier to understand once you encounter it.

    Rockman X Engine Version 0.0.2 Dash and Custom Engine.mfa

  2. #2
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export Module
    Yima's Avatar
    Join Date
    Feb 2008
    Location
    Sweden
    Posts
    104
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi there. I found out what the problem is. When wall jumping, you set the x movement speed (horizontal) to either 7 or -7. The event that causes the speed to decrease does so by moving the speed towards 0 in steps of 3.

    There are two events that causes the horizontal speed to move towards 0:

    Event A

    X Left arrow is pressed
    X Right arrow is pressed
    Horizontal of Colider < 0

    > Add 3 to horizontal

    Event B

    X Left arrow is pressed
    X Right arrow is pressed
    Horizontal of Colider > 0

    > Subtract 3 from horizontal

    So, when jumping left from a wall:

    1. game sees that the speed is negative, and adds 3 to it (horizontal is now -4) (event A) game loop 1

    2. game sees that the speed is negative, and adds 3 to it (horizontal is now -1). (event A) game loop 1

    3. game sees that the speed is negative, and adds 3 to it (horizontal is now 2). (event A) game loop 1

    4. game sees that the speed is positive, and subtracts 3 from it (horizontal is now -1). (event B) game loop 1

    5. game sees that the speed is negative, and adds 3 to it (horizontal is now 2). (event A) game loop 2

    6. game sees that the speed is positive, and subtracts 3 from it (horizontal is now -1). (event B) game loop 2


    Since event B is placed below event A, it will always make sure that horizontal ends up at -1 (resulting in the character sliding to the left). Horizontal never reaches 0 since the events make jumps by 3.

    When jumping right from a wall:

    1. game sees that the speed is positive, and subtracts 3 from it (horizontal is now 4) (event B) game loop 1

    2. game sees that the speed is positive, and subtracts 3 from it (horizontal is now 1). (event B) game loop 1

    3. game sees that the speed is positive, and subtracts 3 from it (horizontal is now -2). (event B) game loop 1

    4. game sees that the speed is negative, and adds 3 to it (horizontal is now 1). (event A) game loop 2

    5. game sees that the speed is positive, and subtracts 3 from it (horizontal is now -2). (event B) game loop 2

    Since event B is placed below event A, it will always make sure that horizontal ends up at -2 (resulting in the character sliding to the left). Horizontal never reaches 0 since the events make jumps by 3.

    The easiest way to solve this problem right now is to set the horizontal to a number that is divisible by 3 after a wall jump is made (6/-6 instead of 7/-7 for example).

    I would however suggest that you solve the retardation in some other way. One way is to change event A (and B) like this:

    Event A

    X Left arrow is pressed
    X Right arrow is pressed
    Horizontal of Colider < 0

    >Add 1 to horizontal (this will always end up at 0, unless you force horizontal into becoming a float number by doing some kind of division - beware of that).

    Event B

    X Left arrow is pressed
    X Right arrow is pressed
    Horizontal of Colider > 0

    >Subtract 1 from horizontal

    Or even simpler:

    Event A (remove Event B)

    X Left arrow is pressed
    X Right arrow is pressed
    Horizontal of Colider <> 0

    > Set horizontal to 0

    I hope this made some kind of sense Just ask if there is anything else you wonder about.

  3. #3
    No Products Registered

    Join Date
    Jul 2013
    Location
    -The Internet-
    Posts
    62
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I knew that i created a complete mess , i couldn't sleep because i knew its a big problem. Thank you Yima, your a lifesaver as always , i shall try it out and see what happens.

  4. #4
    No Products Registered

    Join Date
    Jul 2013
    Location
    -The Internet-
    Posts
    62
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yima..... it WORKS LIKE A CHARM !!! Thank you alot , thanks for helping get rid of the problem. You really are a lifesaver.

  5. #5
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export Module
    Yima's Avatar
    Join Date
    Feb 2008
    Location
    Sweden
    Posts
    104
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No problem - just happy to help!

Similar Threads

  1. Wall Jump :/
    By MonkeyToy in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 8th June 2012, 08:02 PM
  2. Wall Jump
    By ConquerStone in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 3rd March 2012, 01:03 AM
  3. Can't jump when touching a Wall.
    By Carlos182 in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 18th September 2009, 05:01 PM
  4. Wall jump?
    By 007 in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 10th August 2008, 04:52 PM
  5. Wall Jump
    By XBolognaX in forum Multimedia Fusion 2 - Technical Support
    Replies: 23
    Last Post: 22nd August 2006, 10:12 PM

Tags for this Thread

Posting Permissions

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