Comments (9)
oooh, thanks for reporting this ! But yes for sure you certainly right, I'll look into it.
Would you share with me your example ([email protected]), so that I have an example to debug ?
How did you fix this in your flash engine ?
And thank you, melonJS is for sure not yet perfect, but I'm happy you like it !
from melonjs.
Following email discussion with nicnacks on this, For those having the same issue, and while waiting for this to be managed correctly, you can use the setMaxVelocity function to cap the y velocity.
from melonjs.
My question has similar contexts, but how can you kill your character when he/she has falling through a hole/pit. Say you are jumping from platform to platform over a big whole, and you miss the next platform and fall "to your death." What do you need to add in JavaScript to handle this issue? What I want to do is just restart the level.
from melonjs.
Actually you have two options :
1/ check the y position of the player, if y > than the level height, you can assume that you felt into a pit/hole.
this is exactly what I'm doing in Alex4, when the position is updated I have the following code :
// check if we fall somewhere
if (this.pos.y > this.ylimit) // <- ylimit being the vertical limit of the level
{
this.die();
}
2/ you can use a invisibleEntity, and make it die or go to the next level when the player touch it
This is also what I'm doing in Alex4 (in case you played it) : when you reach the end of the 1st level, you have to jump into the pit to access the next level.
I can send you alex4 source code if you want, just send me an email to [email protected]
Actually I think I should post the source of it as well, maybe add a link to it in the gallery page.
from melonjs.
I created a new ticket for doing collisions in multiple phases, mostly as a performance improvement. But it will also solve this bug by taking the guesswork out of the collision resolutions: #103
from melonjs.
should be covered through #538, closing this one
from melonjs.
Reopened, since this is still an issue, as demonstrated here (using melonJS build 518 from Travis-CI): http://jsfiddle.net/4s1rauye/
from melonjs.
To make the ball properly hit the wall. Lower the velocity on line 59 like this:
this.body.vel.set(12, 0);
Then note that the ball still falls through the floor (which is only 1px thick)
from melonjs.
ok, I'm closing this one for the following reasons :
- the problem was only visible in earlier version of melonJS, and the cap to
maxVel
is "hiding" the issue - the ticket is redundant with other tickets were we discussed about having a better physic implementation : #235 #285 #588 , in the sense that the later 3 will not have such issue.
from melonjs.
Related Issues (20)
- Fix code scanning alert - Polynomial regular expression used on uncontrolled data
- Optimize the `arcTo` function to use `gl.LINES` HOT 1
- Cache or optimize triangulation data used for drawing with fill operation
- `textImage2D` does not accept OffscreenCanvas anymore as a pixel source for texture
- optimize matrix operations using Strassen algorithm ? HOT 5
- compressed textures in WebGL HOT 3
- WebGPU renderer
- TypeScript defenition for loader.preload incorrect HOT 6
- [Feature request] More realistic progress based on bytes for loader and preloader
- Texture is never removed from TextureCache
- TextureCache.length can't be decreased HOT 5
- support using SVG path data when creating a Path2D path HOT 1
- this.body is pointing to Dom type when using Typescript Boilerplate HOT 8
- Animation created from atlas: misaligned hitbox HOT 1
- Some of the Github pages examples are broken HOT 3
- Difficulties with UITextButton HOT 6
- Animation broken on WebGL if TextureAtlas has multiple textures HOT 9
- The result of the flip object vibrates
- Hyperlinks to source code within documentation contain absolute path on obiot's PC HOT 4
- withCredentials does not get set in fetch calls HOT 3
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 melonjs.