Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

Same gravity.y Value produces different rate of falling


GooseZA
 Share

Recommended Posts

Hi all, 

 

I ran through the "Making your first game" tutorial with no issues. I'm busy experimenting with my own little platformer now but gravity seems to be different between the two projects? 

 

I have the exact same code for my player as in the tutorial but in my new game, with a gravity of 6, the dude falls VEEEERY slowly. To get the same speed as the tutorial I have to set the gravity.y to about 600! Any ideas?

 

The only difference between the two is that the new project is using a tilemap. 

    player = game.add.sprite(32, game.world.height - 300, "dude");    //give him some physics    player.body.bounce.y = 0.2;    player.body.gravity.y = 6;    player.body.collideWorldBounds = true;
Link to comment
Share on other sites

Thanks for the reply. It gets weirder though.

 

The gravity is only messed up if I use the UNminified version. If I use the minified version it's all good, BUT then my spritemap functions break ='(

 map = game.add.tilemap('map');    map.addTilesetImage('maptiles');

Throws an error with the min version...

 

I'm going to download again just in case I got the files mixed up somewhere...

Link to comment
Share on other sites

You were right. THe tutorial uses 1.1.3 and I'd downloaded the latest from gitHub (1.1.5 i think). 

 

I'd somehow included 1.1.3 unminified and 1.1.5 minified in my new project which explains the gravity diff and different functions available!

 

*facepalm

 

Carry on =)

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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