Comments (3)
@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.
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.
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.
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.
@apaatsio I switched to onPreUpdate
seems to do the right thing, thanks for the find!
from sample-platformer.
Related Issues (6)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sample-platformer.