Question: FOR PYTHON ----> In a file named flappybird.py, implement a FlappyBird-like game using pygame. In particular, There should be one kind if user input, a

FOR PYTHON ---->

In a file named flappybird.py, implement a FlappyBird-like game using pygame.

In particular,

There should be one kind if user input, a vertical flap action triggered by either a mouse click or the space bar (your choice) you do not need to use an animated sprite sheet for this assignment

There should be randomly generated scrolling obstacles (pillars) with openings at random heights

Touching the ground or a pillar should end the game

Score should be based on how long the player lasts before the game ends

When the game ends, the score should be displayed visually in the game screen

We wont be able to perform automated testing for this submission (well have course staff run it to grade it), but you should be able to tell if it is working on your own by playing the game youve created.

In implementing the game, avoid over-running the computers resources. In particular

Dont draw() a gamebox for a pilar until it is almost on the screen

Remove (or re-use) pilars that go off the screen behind the player

Typically this means having some logic like this in your tick function:

if the left-most pillar is off the left side of the screen, move it to some distance past the right side of the screen re-randomize its opening's vertical location 

That way you can have a small fixed number of pillar objects in Python look like an endless stream of pillars when playing the game

FOR PYTHON ----> In a file named flappybird.py, implement a FlappyBird-like game

2. Troubleshooting The infinite jumper example games (all three sections had one) might be a good starting point. You don't need to implement anything we don't ask for (e.g., animation, images, sound, background images, etc), though you may as long as you still implement what we do ask for Many questions of the form "how do I do X" are answered in The PyGame Docs If you do a web search for "Python flappybird" you'll find a lot of code that will get 0 points if submitted. Use gamebox, in a way similar to our examples from lecture and lab

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!