kodyrouse Posted October 30, 2018 Share Posted October 30, 2018 In my mobile game, the main character needs to jump to a specific y point before starting to fall down again due to gravity. How could I calculate the y velocity I would need to reach (at peak) a given y position with a given gravity? I tried to do this with a tween instead of arcade physics because it was exactly what I needed (distance traveled over time with a gravity-like effect), but the performance was not good and was constantly sputtering. I'm currently using Phaser 2.6.2. Thanks! Link to comment Share on other sites More sharing options...
dude78 Posted November 13, 2018 Share Posted November 13, 2018 Hi, @kodyrouse. Did you solve your problem? One simple tween slow your game down? It's better to show at least the part of your code then. I read questions and see "Phaser 2.6.2" from time to time. There is Phaser 2.11.1 as I remember as of now and documentation is available here: photonstorm.github.io/phaser-ce Link to comment Share on other sites More sharing options...
kodyrouse Posted November 13, 2018 Author Share Posted November 13, 2018 This answer worked for me (answer I got from Stack Overflow) height = velocity^2 / (2 * gravity) Gravix, dude78 and samme 3 Link to comment Share on other sites More sharing options...
Recommended Posts