Flappy Bird Code Walk-through

Hi,

I think we can all agree the world does not need another Flappy Bird style game!

That said, the game is a great example of the kind game that Corona SDK is perfect for creating.

To help newer users learn from such an example, I’ve created a version of the game along with a full 1.5 hour code walk-through that starts here:

http://www.youtube.com/watch?v=qHIZLfcDkUo&feature=youtu.be

Furthermore there is the source code available here:

Storyboard:

https://www.dropbox.com/s/rhujlp2d3zljhck/Flappy%20Bat%20-%20Storyboard.zip

Composer:

https://www.dropbox.com/s/vznlv750x5fpl1z/Flappy%20Bat%20-%20Composer.zip

Hope it helps!

Mark

How to make the bat rotate like in the flappy bird game?

Hi Mark,

Thanks for your contribution. May I suggest that you add this to the Code Exchange for better exposure over the long run?

http://code.coronalabs.com

Best regards,

Brent

Hello, How can I add ads into app with admob can you explain?

How to make the bat rotate like in the flappy bird game?

Hi Mark,

Thanks for your contribution. May I suggest that you add this to the Code Exchange for better exposure over the long run?

http://code.coronalabs.com

Best regards,

Brent

Hello, How can I add ads into app with admob can you explain?

Hi

talking about flapping method

i find using standart transition.to is better than using applyLinierImpulse or applyForce methode.

also i just made a game with this method here

https://play.google.com/store/apps/details?id=com.gmail.sukmaa.gozilla

the flapping tap is better and more predictable, please have a look

[lua]–main.lua–

vertices = {-22,-15,20,-20,23,13,-27,26,-18,14}

bird = display.newPolygon( 100, 100, vertices )

function fall( event )

    falling = transition.to( bird, {time=800, y=bird.y+500, transition=easing.inSine} )

    fallrot = transition.to( bird, {time=500,rotation=60, transition=easing.inSine} )

end

function upp( event )

    if event.phase == “began” then

        bird.rotation = -20

        transition.cancel() --cancel all transition

        up = transition.to( bird, {y=bird.y - 50,time=200,transition=easing.outSine, onComplete=fall})

    end    

end

Runtime:addEventListener(“touch”, upp )

[/lua]

Hi

talking about flapping method

i find using standart transition.to is better than using applyLinierImpulse or applyForce methode.

also i just made a game with this method here

https://play.google.com/store/apps/details?id=com.gmail.sukmaa.gozilla

the flapping tap is better and more predictable, please have a look

[lua]–main.lua–

vertices = {-22,-15,20,-20,23,13,-27,26,-18,14}

bird = display.newPolygon( 100, 100, vertices )

function fall( event )

    falling = transition.to( bird, {time=800, y=bird.y+500, transition=easing.inSine} )

    fallrot = transition.to( bird, {time=500,rotation=60, transition=easing.inSine} )

end

function upp( event )

    if event.phase == “began” then

        bird.rotation = -20

        transition.cancel() --cancel all transition

        up = transition.to( bird, {y=bird.y - 50,time=200,transition=easing.outSine, onComplete=fall})

    end    

end

Runtime:addEventListener(“touch”, upp )

[/lua]