Jump to content

Gravity Speed


mdhdev
 Share

Recommended Posts

Using P2 physics, what would be a realistic gravity setting for a marble falling to the ground?

 

I have set game.physics.p2.gravity.y = 500 which seems a bit slow in firefox but quite a bit faster in Chrome.

 

500 sounds a bit hight and i'm wondering if that's a normal setting? Also, is it normal to have speed differences between Chrome and Firefox?

Link to comment
Share on other sites

No 500, is not unusual neither extreme, at least for the arcade physic I use, never tried the P2 but I guess it's the same speed (I said I guess).

 

I know in arcade physic engine, when you go beyong 1000 or so, you need to use the game.physics.arcade.TILE_BIAS, to avoid having the sprite going through the floor after a relatively short free fall, don't know what's the equivalent for P2, or if any needed.

Link to comment
Share on other sites

Firefox is a loosy browser quite frankly, for games.

 

It's filled with politics, unfortunately.

For instance the flash player is limited to 30 fps.

 

Why ?

 

Either because it's poorly implemented or <conspiracy theory>plain sabotage</conspiracy theory>.

 

So, I'm not surprised that javascript is slower.

 

The only good part is that FF is more tolerant regarding bad practices, but that's a false friend.

Link to comment
Share on other sites

the new firefox is quite the same to chrome performancewise..   with webgl on linux it's a little bit slower..

 

if you see a difference in the speed of your marbles falling down you should activate advanced timing and display the current fps :  you should see that there is a difference in the frames per second..  because most things are calculated in frames - processing 60fps will be twice as past than 30fps - this also is true for gravity..  so make sure your game is coded in a way that you will have 60fps almost all the time..

 

 

btw.  a normal setting for p2 physics to imitate real gravitation 9.81 g would be 1200 - 1400   so don't worry.. 500 is actually very low

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...