Coder Social home page Coder Social logo

Falling Bug about melonjs HOT 9 CLOSED

melonjs avatar melonjs commented on May 11, 2024
Falling Bug

from melonjs.

Comments (9)

 avatar commented on May 11, 2024

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.

 avatar commented on May 11, 2024

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.

amauch avatar amauch commented on May 11, 2024

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.

 avatar commented on May 11, 2024

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.

parasyte avatar parasyte commented on May 11, 2024

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.

obiot avatar obiot commented on May 11, 2024

should be covered through #538, closing this one

from melonjs.

parasyte avatar parasyte commented on May 11, 2024

Reopened, since this is still an issue, as demonstrated here (using melonJS build 518 from Travis-CI): http://jsfiddle.net/4s1rauye/

from melonjs.

parasyte avatar parasyte commented on May 11, 2024

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.

obiot avatar obiot commented on May 11, 2024

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)

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.