Giter Site home page Giter Site logo

Comments (6)

Bergasms avatar Bergasms commented on May 1, 2024

is collision detection being done using the current location, if so it should either be changed to handle a collision anywhere on the line from the previous location to the current location, or fall speed should be capped at a limit so that you cannot completely move through a box when falling maybe.

from craft.

Aaron1011 avatar Aaron1011 commented on May 1, 2024

Collision detection uses the current location. See the collide method.

from craft.

Bergasms avatar Bergasms commented on May 1, 2024

Ta, I have been following this project but haven't had a chance to apply anything. If no one else gets to it i might have a go at fixing collision to check for intersection over the step from N-1 to N

from craft.

amarseillan-zz avatar amarseillan-zz commented on May 1, 2024

It's not too crazy to cap the falling speed. Bodies falling DO have a maximum speed.
Anyhow, this doesn't fix the fact that collision of a body at high speed could fail being detected.
@Bergasms At a higher speed could N-1 to N not be enough??

from craft.

Bergasms avatar Bergasms commented on May 1, 2024

N-1 to N will always be enough, As there will always be an N-1 such that the player has not fallen through the block, followed by an N where they have either contacted or passed through the block. Maintaining the players location at the previous tick is useful for all sorts of reasons as well. If the player somehow gets themselves into an invalid position you can just roll them back.

from craft.

amarseillan-zz avatar amarseillan-zz commented on May 1, 2024

@Bergasms Totally right, you used the segment to check for a block in the middle, ty!!

from craft.

Related Issues (20)

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.