Quantcast
Channel: Question and Answer » libgdx
Viewing all articles
Browse latest Browse all 434

How do I derive an appropriate acceleration value for my game?

$
0
0

I am creating a Flappy Bird clone from this tutorial.

I have a question about acceleration in libgdx. The author assigned the bird a constant acceleration vector in the constructor of the bird

        acceleration = new Vector2(0, 460);

and later updated the velocity vector from the accleration vector with

        velocity.add(acceleration.cpy().scl(delta));

I understand generally why acceleration is constant – like the author mentioned, acceleration due to gravity is 9.81m/s^2, meaning that the speed of an object falling will increase by 9.81m/s every second. It seems the author somehow got from 9.81 real world value to 460 in the actual code. How does one go about deriving this value? Is this a standard derivation or something the author just made up?


Viewing all articles
Browse latest Browse all 434

Trending Articles