Question

I'm using the Corona SDK with the Box2D engine, and I'm trying to make a Flappy Bird style game just to get familiar with the physics engine. I've tried increasing the density of the main character, increasing gravity, changing the scale of the physics stage, etc, but the main character still feels too "floaty".

Increasing the gravity came as close as I could to feel right, but there are still issues. If the user taps the screen quickly in succession, the momentum builds up quickly and the character goes flying up off the screen at high speed. Here is my code right now:

physics.setGravity( 0, 60 ) --default is 9.8

function screenTap()
    flappy.isFixedRotation = true
    flappy:applyLinearImpulse( 0, -300, flappy.x - 3, flappy.y )
    flappy.isFixedRotation = false
end

In the original Flappy Bird game, it seems to have normal gravity, but rapid taps to the screen wouldn't make the bird fly up too quickly. It almost had the feel of something "heavy" like a bowling ball, but obviously in this world objects of all masses fall at the same speed. I don't have much experience with physics engines, so I would appreciate any suggestions.

Was it helpful?

Solution

If you have played flappy bird recently, you should have observed that when you tap the bird in rapid succession, its vertical velocity does not increase! The flappy bird developer seems to have made the bird's vertical velocity set to a certain value whenever it is tapped rather then have it accelerate vertically.

So, my advice would be to simply set the character's vertical velocity to a set value whenever the screen is tapped instead of accelerating it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top