Tomáš Nosek
Tomáš Nosek

Reputation: 213

Creating a flappy bird animation

I am pretty new in Java and I am working on my own flappybird game copy. Just teoretically, how would you create the animation of the bird? Should I do it as a compilation of many pictures or is there any Class which could change the angle of the bird when It goes up?

Upvotes: 0

Views: 329

Answers (1)

Edwin Buck
Edwin Buck

Reputation: 70909

In very general terms, I would have an animation (a series of pictures to be played in response to an event and the passage of time).

Then I would set an animation for the object (the bird) and the start time of the animation each time someone presses the space key. Then, as my timing loop advances, I'd check to see if the sprite's presentation needs updated based on the time elapsed since the animation started.

Once the animation has no more sprites to present, I'd go back to the bird's normal sprite.

Upvotes: 1

Related Questions