Rydez Posted February 1, 2017 Share Posted February 1, 2017 Hello! I'm making a game with Phaser and using arcade physics. I can't find any information about how to scale the physics with the size of the browser. I would like to scale the physics (gravity, velocity, etc.) so that game play remains the same when the game size is changed via a browser resize. Anyone know how this can be done? Edit: I should've added, my current method is to use scaling factors that are used to recalculate certain dimensions and physical properties when the resize function is called. But I'm not exactly sure how to do the math to calculate these scaling factors, especially for gravity. Link to comment Share on other sites More sharing options...
Rydez Posted February 1, 2017 Author Share Posted February 1, 2017 I think that I've figure it out. Just having the physics as a fraction of the game dimensions. For example, in the resize function: this.player.body.gravity.y = this.playerGravityFraction*game.height; Link to comment Share on other sites More sharing options...
Recommended Posts