Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

A5 Goals

The main goals of A5 are to

· develop and use some simple classes

· practice looping over lists and calling methods on each list element

· practice using list comprehensions to modify lists

Partners

This is an optional partner assignment. When working with a partner, both must code. You should share screens and have one person type while the other person advises. For the next session, transfer files, and the other person should type. A submission where one person is unable to meaningful describe what is going on in the code is considered academic misconduct.

When submitting on Gradescope, you will be able to indicate your partner. You must do this. At the top of your file, add a comment with both partners listed as authors. Only one of the people in the pair needs to submit. 

A partner is optional. Just submit as usual if no partner.

I will add a Piazza discussion thread where you can look for a partner. Please be thoughtful in discussing time availability, goals in the course, and programming comfort. In general, two partners with similar programming skills works better than one who is more proficient than the other.

I am not using GitHub for this assignment as I want to evaluate how it worked for the last one.

Assignment Theme

You will make a Pygame game. This simple game has a player sprite that follows the mouse. There are enemies that bounce around the screen. Touching an enemy reduces your life. There are powerups that add to the life, and that disappear when touched. The game ends when your life goes to zero.

An example of this style game is here

Assignment Requirements

Start with this initial code: BounceGameStart.pyLinks to an external site.

Rename the file to BounceGame.py. Add it to PyCharm. Add Pygame to the project as needed and as done in lab.

There is one completed class named Sprite, based on the lecture materials that showed how to build this class. This class is for a player object that follows the mouse.

There are two other classes that are related to Sprite that have empty methods that need to be implemented.

Enemy: The enemy class is like the Sprite, but it starts the game in a random position on the screen and with a random speed. Each turn, the speed is used to shift the rectangle positions the Enemy image. Each turn, the Enemy needs to see if it has reached the side of the screen, and then it should bounce. The bounce method tests for this, and changes the speed to bounce off the side. Touching an Enemy makes the player lose life.

PowerUp: The PowerUp class is a stationary Sprite that appears on a random spot in the screen. Touching a PowerUp lets the player gain life, but the PowerUp goes away.

Carefully read the comments in those classes for guidance how to implement the methods.

Then, the main function has some code but also has comments guiding how to make a playable game. Implement code as directed.

Doing, this, you should have a game similar to above.

Creative Element

Based on this game concept, add your own creative element. There should be two main parts to this:

1. Decide on a theme for the game. Find or draw or modify images to support this theme. Use them for the player, enemies, and powerups. An important part is finding an image with a transparent border. There are a number of tools and websites to help make a background transparent (for example, an image with a white background). Share some good places on Piazza!

2. Think of a fun variation on the basic game to make it more interesting to play. This should not be a one line change (like change the number in the wait to make it go faster). My guess is that you should have between 10-100 lines of code to do something worthwhile, but that is just a rough guide. It could be adding a method to a class to let it do something more, or even adding a new class. It should show insight and caring about the impact on the game play. Partner projects should expect to do a little more here. I am deliberately not giving much guidance here so as to not influence your creative choices.
Write a comment at the top of the python file explaining what your theme is and the creative addition.

Submission

Record a small video showing your game being played. A good option is to start Zoom and then share your screen (or portion) and then record your screen. Play enough to see life go up and down. There are many other tools. Some make huge files of hundreds of MB. Gradescope cannot handle those. If you need to, submit a link to some place you are sharing the video.

Submit the .py file you used, all images or other files used in the game, and the video of the game. If you have a partner, add the partner's name during the submission process on Gradescope.