frame

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Register

Maybe bug, but I might be wrong

edited February 2 in Bugs
Untitled
I have no idea why this happens but when I go back a very specific amount & jump I will get what I think is a double jump. The ray actives when it hits a certain block & makes a sound so it's not that. If anyone has an idea of how this could be my fault please tell me. Game Link - http://flowlab.io/game/play/1033540

Comments

  • I think it is a big it has happened in my games too!
  • edited February 2
    Hey @TheForgotten - I checked out your game and I can reproduce the issue.

    I watched the behavior blocks while it happens, and can confirm it is not the raycast causing the problem.

    Here's the exact sequence of events that causes the double jump:

    1) Dog is moving on x axis
    2) Player presses "w" to jump, sending an impulse force to the Dog
    3) Dog is still moving left, and touches the next ground block before leaving the ground (adding a force does not move the object instantantly, this happens over time)
    5) Now the switch is on again, the Dog gets another jump force

    I think that just turning off "repeating" on the jump key would fix this - do you have repeating enabled on purpose?

    If you wish to have a repeating jump button, another fix would be to move the dog a pixel or two up when pressing jump, so that the Dog cannot touch a second ground block

    Another possible fix would be to just use some raycasts to check for the ground instead of the collision/switch method. If you do this, be sure to use a few of them so you don't get stuck on an edge.
  • edited February 2
    @grazer I did think that maybe the issue so I added a delay of 4/10 of a second on the collision, so that'd mean for whatever reason the impulse is being delayed when you walk in a different direction. I will find a way to prevent this for right now but could their potentially be an update that could stop impulses from being queued and rather act immediately?
  • Hey @TheForgotten - impulses are not queued, they are already applied immediately. The issue is that an object accelerates over time:

    Acceleration = Force/Mass

    This means that (depending on the force and mass) the object may not move enough in a single frame to clear it completely from contacting another object. You could add more force (or decrease the mass) enough to resolve the issue probably, but that would mess up the feel of your jumping. Moving the sprite up a pixel or two when you press jump will ensure that no more ground collisions happen, and also make the jumping feel a little bit snappier IMO.




  • edited February 2
    nvm I know understand xD.
  • @grazer I could do that but I have thought of an easier way this could be done but it'd involve adding a feature that i've wanted for a long time. A input for the collision called "check" which will make it recheck if its touching the given block.
  • f
    btw @seamothmaster45 here is a fix just prevent collisions for a good bit after the jump.
  • oh ok thanks!
Sign In or Register to comment.

flowlab.io

| make games in your browser
@ 2017 Flowlab.io, All rights reserved.

Contact us

Get In Touch