Giter VIP home page Giter VIP logo

Comments (3)

eonarheim avatar eonarheim commented on May 25, 2024

@apaatsio Good find! Double jumps definitely not intentional.

Must be something odd about https://github.com/excaliburjs/sample-platformer/blob/master/src/bot.ts#L59 allow the jump to be registered https://github.com/excaliburjs/sample-platformer/blob/master/src/bot.ts#L99

from sample-platformer.

eonarheim avatar eonarheim commented on May 25, 2024

Okay, this is a subtle issue but I believe this is because the collision resolution runs after actor update.

Immediately after the jump the actor update is complete and the jump impulse won't be applied to position until the next frame, so still colliding.
image

In the same frame, collision is processed and the actor geometry is still intersecting so onGround is set back to true, making a double jump possible in the very next frame.
image

Potential solutions:

  • Switch to onPreUpdate to ensure impulse is processed the same frame as collisions
  • Shift the actor pos.y up to keep from re-colliding with the floor the same frame as the jump

from sample-platformer.

eonarheim avatar eonarheim commented on May 25, 2024

@apaatsio I switched to onPreUpdate seems to do the right thing, thanks for the find!

from sample-platformer.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.