Assignment 11: Adventure Game


Hello, if you have any need, please feel free to consult us, this is my wechat: wx91due


Assignment 11: Adventure Game

• Due Thursday by 11:59pm
• Points 100
• Submitting an external tool
• Available after Nov 21 at 12am
Assignment Goals
The goals of this assignment are to:
• Develop an interactive application using a game loop structure
• Write a larger project to practice skills in managing complexity and using good code style
• Design a program where your creative skills play a role

Pair Programming

As for all of our assignments, you are encouraged to work with a partner. Coding should all be done together, you cannot do each level individually andthem combine them at the end.
Getting Started

Download the starter code from this shared folderLinks to an external site..

You may want to make a new project for this assignment to help you track and manage the different images or files you use, or to control access apartner has to your files - if you do, make sure to add a Python interpreter andadd Pygame to the project. You should copy and paste the files from thestarter code (or the folder) into your project (from your computer select the files or folder and copy, then go to PyCharm, click on the project name in theproject view, and paste).

Assignment Requirements

You are to make an adventure game.

First, decide on a theme for the game. This will help you decide what the player character is, what the game characters are, and any challenges.

Write a brief description of the theme in a text file for submission as partof Assignment 11a. This should be a few sentences.

The game itself must have at least the following parts:

1. When the game starts, some kind of maze or area of obstacles with a start and stop and some guards or challenges should be displayed.
• The player can move freely at this point.
• The player character should follow the mouse cursor (without needing to press a mouse button) or use keys to move around.
2. If the player clicks on the start image, then the level is activated.
• Touching a wall or some guard or challenge element after start has been pressed ends the game (or optionally restarts the level or game).
• A message should be displayed (in the display_loss_function in the display_win_or_loss file).
• Call pygame.quit() and return False to end the level.
3. If the player makes it to the end image the level is complete.
• The player should not need to click on the end goalimage, just touch it.
• Call pygame.quit() and return True to end the level

4. When a level finishes, a new level should be displayed, and the player can again move freely until a start is clicked.• Treat the new level as an independent game. Call pygame.init() and have a game loop.

5. After at least three levels, a winning game over image or message is displayed.
6. You can use the little text example in the starter code to display a level or a hint for a level if desired. You can also remove it.
7. Each level must:
1. Use a different background image.
2. Have different non-player character images.
3. Have a different challenge to get to the end.

• This difference must be in both images used and the kind of challenge. This means the code implementing it will also be different in style.

• You can use the idea of finding something to get past something else as one of your challenges - but only one.

4. You can search online for images. Search something like "key image transparent background".

5. Many of you may want to animate something as a challenge. There are two main ways of moving things around. You can use a series of images, for example a guard with a large transparent border, and the guard shifts position within the image, and you cycle throughimages (and masks) like we did in lab. Or even a whole series of  map images. Another approach is to move the rectangle for a guard. You can imagine choosing a position out of a long list of positions as one approach, also using the ideas from lab to cycle through positions. You can also consider moving in one direction until going too far, then using a variable to change it to moving back in another direction. Make sure to cite your sources if you use code or ideas from sources other than class and the Pygame documentation. Do some experiments in code to see if you can get something working before integrating it in the larger game.

6. Part of the challenge for this assignment is to:
• Have an idea
• Work through how to implement it in Python.

• Having an idea you don't have a way to implement is not really a useful idea.

8. You do not need to restart at the current level when you fail (but you can). I would recommend starting at a higher level by editing the code when developing the game so you can skip doing the earlier levels when testing.

9. Remove console print statements that are in the starter code or added for debugging by you before submitting. Remove experimental code you are no longer using. Add your name(s) to the comment at the top of the file.
10.If you added functions, provide docstrings.
11.You do not need testing code.

While this project uses some new concepts in making an interactive game, the real challenge lies in managing the complexity of the project. You will find that using good variables names helps to develop and debug your code. You may find that breaking the project into parts (for example, by level), can help you manage the complexity. A few comments to guide you as you insert more code may also help.

Implementation

In the provided code, there is a game.py which calls each level and then calls a loss screen if the player did not complete the level or calls a win screen if all three levels are completed. You may modify that file if you want more levels or if you want to restart a level upon a loss (for example, using a while loop). Read the code in that file to get a sense of the overall structure.

The game.py should be run to run the entire game.

You will likely need to modify the game and level files to initialize Pygame and create and use a window. You can add code to game.pyto make the screen and you can add parameters to the level functions to use the same screen.

You can also close a window at the conclusion of the level (pygame.quit()) and then in the next level or win/loss screen do another pygame.init() and make a window for the next level.

There are files for each level (level1, level2, level3) and for the win or loss display screens.

In each level file, add code to the level function to load images as needed and then have a complete Pygame game loop with event checking, game update, and drawing. If the player fails, return False. If the player completes the level, return True.

There is an example level 1 file that is not fully functional. It does not have thestart and end. It does return False if the door is touched. Build on the ideasin this example to make your own unique levels. Do not call this level in your completed game. Modify game.py to call your level1 function instead of this example function.

There is a display_win_or_loss.py file with two functions. Add a complete Pygame game loop in each function and use it to display a win orloss message.

Test each level independently by commenting out code in the game.py file.

When submitting, have a fully functional game.

Code Style

Use good code style throughout. Add docstrings to functions you write. This project is likely a good place for one line comments in the level functions giving some guidance as to what is going on.

Due Dates

This is a larger project with a mid-project checkpoint.

Tuesday, December 3rd, 5:00PM - meet with a member of the course staff to get credit for Assignment 11a. See the description in Assignment 11a for details. You can submit up to one day late for a 10% penalty. After Wednesday, December 4th at 5:00PM there are no options to get credit for 11a.

Thursday, December 5th, 11:59PM - the project due date. Submit the project on Gradescope.

Saturday, December 7th, 11:59PM - a no penalty late submission due date. Submit the project on Gradescope.

There are no further late days with penalty after Saturday or any ability to use late passes (instead, everyone gets essentially a "free" late pass for this assignment). I am waiving the penalty and extending the late period, not making two round of late days. Please be aware that course staff does notwork over the weekend, so if you have a question or have trouble submitting over the weekend, you will not have support. Try to submit as early as possible to avoid such issues.

Since this assignment is due the last day of classes/course activities (except the final), there will be no opportunity for point recovery for thisassignment.

Submitting

Make a short video showing a play-through and at least failing on one level. A voiceover is needed to help us understand what is going on. A reasonable way to make a video is to use Zoom and share your screen. Make sure that you share a screen to capture things like any popup windows - if you just share a window, other windows can be missed by the video capture. If you are a team, all of you must participate in making the video (at least by some division of voiceover duties).

If you have a partner, when you submit on Gradescope, one person willsubmit and add the partner to the submission through Gradescope. Youshould double-check your partner has added you to the submission if you arenot the submitter.

Submit all .py files, image files, and any other needed files along with the textdescription of the theme and the video file. If the video file is too large, provide a text file with a link to an online storage for the video file and name the file with the link something obvious to make it clear there is a video. Do not submit an entire project which includes the pygame library files. Besides making it very hard to find your files, it often freezes Gradescope as it tries to upload thousands of files.

发表评论

电子邮件地址不会被公开。 必填项已用*标注