GithubHelp home page GithubHelp logo

syzygy's People

Contributors

t1mmos avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

t0mac0

syzygy's Issues

A player might be able to enter a wall on a corner

p = (px, py): current player position
v = (vx, vx): offset to walk to in next frame

The check currently checks whether (px + vx, py) or (px, py +vy) is inside a wall and sets vx, vy or both to 0 accordingly. This nicely results in 'gliding' against a wall at lower speed. This collision detection works on nearly all situations. However, imagine a player facing the corner of a isolated wall block - block at grid position (x, y) and player is inside grid position (x - 1, y - 1). As he comes closer to the wall's corner, the checks will not trigger until he is actually at position (px +vx, py +vy) in which case both checks will trigger the next frame, but then it's too late - the player is inside the wall.

We need to check also against (px + vx, py + vy) if the available checks are not triggered (because 'gliding' occurs in that case), and choose a gliding direction to not be stuck at a corner.

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.