# Can someone explain Flappy Bird's physics to me? [closed]

I am having a difficult time trying to understand the Flappy Bird physics. I know it seems simple but I kind of suck at math. I am trying to see if I can make a simple game like this but it is just the dang physics that are throwing me off. I have something like gravity effecting the bird but when you click the screen and I add some amount to the y position but it doesn't look good. You guys have any ideas?

Stuff like:

velocity += -9.8 * Gdx.graphics.getDeltaTime();
position.y += 0.5 * velocity;


That is falling but when I tap the device I would like to know how to add upward force but when it loses it continue falling.

• Show us concrete examples of what you have tried. – user15805 Feb 11 '14 at 22:13
• That code was in the update method and created a realistic fall but don't know how to add upward force. – G3tinmybelly Feb 11 '14 at 22:22
• This question appears to be off-topic because it is about how things are done in a specific game – MichaelHouse Mar 1 '14 at 15:36

The bird falls continuously, and when the user taps the screen, it 'jumps' a bit. That's all there is to Flappy Bird's physics.

We use a variable called vertSpeed to keep track of the bird's vertical speed (positive if it goes up, negative if it falls down). jumpSpeed is a positive constant, to which the speed gets reset whenever the user taps the screen. This will immediately make the bird start its ascension. fallingConstant is again a positive constant, which accelerates the bird's decrease in vertical speed on each update. This makes the bird increase in speed when falling.

vertSpeed = 0;

method Update()
{
if (PlayerTappedScreen)
{
vertSpeed = jumpSpeed;
}
Position.Y += vertSpeed * deltaTime;
vertSpeed -= fallingConstant * deltaTime;
}


From here on, all you have to do is experiment with the values, to find a set that works best for you.

• would the falling constant be something that is small or a larger number? – G3tinmybelly Feb 11 '14 at 22:39
• Interesting. I started to teach my stepson how he could "make a game from scratch" this week (using Processing and a bounding ball), and I was giving the bird a fixed impulse vertSpeed += speedIncrement and upon playing he immediately complained of the behaviour. When I started to assign vertSpeed to a fixed speedIncrement (or jumpSpeed if you want), he then instantly recognizes the actual FlappyBird "feel". – heltonbiker Apr 15 '16 at 20:20