Game Big problem Logic:
Join the scene, join the bird game to start, constantly add water pipes to the scene, the bird by physical influence has a downward gravity, each click on the screen to give the bird an upward force, the bird's X-value remains motionless, the scene left scrolling, because the motion is relative, so it looks like a bird and then fly to the right. Added collision detection, if the bird hit the water pipe, then the game failed. Conversely, if each has a water pipe over the bird and no collision, then the score plus 1.
The bird has a looping animation that is not bound to move up or down. There is a background behind the scene that does not scroll, which can create a sense of depth.
Checkout interface:
Award bronze with score greater than 10 points
Score greater than 20 reward silver
Score greater than 30 bonus gold medal
Best:
If you are currently playing for the first time, save the current score as best. If there is a previous best to compare the current score with the historical best, if it is greater than best, then save the current score to best.
Leaderboard: (stored by the server, showing only the top five)
Save the first five scores to the database, and then a new record is compared to the database, if it is greater than the minimum, the deletion is minimal and the current score is saved to the server.
This article is from the "accumulate" blog, make sure to keep this source http://zhanglh.blog.51cto.com/8989396/1633686
Flappybird implementation (a) logic