GooseZA Posted February 16, 2014 Share Posted February 16, 2014 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 More sharing options...
ZRT Posted February 16, 2014 Share Posted February 16, 2014 I had the same issue minutes ago and figured it out! If you're using Phaser 1.1.5 just set a higher value for gravity. Hope it helps. this.player.body.gravity.y = 300; Link to comment Share on other sites More sharing options...
GooseZA Posted February 16, 2014 Author Share Posted February 16, 2014 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 More sharing options...
GooseZA Posted February 16, 2014 Author Share Posted February 16, 2014 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 More sharing options...
Recommended Posts