CMU 15-112: Fundamentals of Programming and Computer Science
Collab 4 (Due Monday 28-Sep at 8pm ET (Pittsburgh-time))
- This assignment is collaborative.
No solo work allowed!.
- Even though this is collaborative, you must each fully understand your solutions and show your work, and you should be able to explain your team's work by yourself to your group and your TA.
- To start:
- Download this file into your week4 folder:
-
cmu_112_graphics.py
-
NOTE! THERE IS NO STARTER FILE!
- Instead, create your own python file called collab4.py in your week4 folder.
- Be sure to import cmu_112_graphics!
- We recommend you screenshare through Zoom and enable remote control for your partner, since repl.it will not play nice with basic_graphics.
- You will both need to submit to autolab, so make sure you share the solutions you create together!
- Don't forget to submit!
- Work together to solve each problem. Do not do any work by yourself!
- Do not use lists or recursion this week.
- Follow all TA instructions!
- Important: Like in previous collabs, you will be graded on demonstrated effort and collaboration rather than completion. Your participation in discussions is much more important than the completeness of the code you eventually submit, so make sure to actively participate at all times. Your submission just needs to make it obvious that you tried hard (during your three hour time). Your grade also depends on you being courteous to your groupmates, and attentive at all times.
- Ask your TA if you have any questions!
- Super Pong!
Today you're going to add some neat new features to our Pong demo in the notes. The group will briefly discuss the following extra features, and just a bit about how one might implement them. Then, you and your partner(s) will try to add as many of these features as possible, starting from the Pong in the course notes.
Your TA will make sure that at least one team from your group is working on each feature first. Note: We hope you will finish one of these within the allotted time, or perhaps even two, but you will not be graded on completion. Your code must demonstrate effort, however, and your TA should be able to see you have collaborated well.
Here are the elements you must all implement:
- Include a simple splash page (i.e. a title screen before you start the game)
- Pressing a digit toggles the extra feature indicated by it's number below
- Each time you toggle a feature, a 'toast' message appears notifying the value of that feature, and stays visible for 3 seconds (hint: use time.time())
Now try to implement as many of these features as possible!
- Colorful Mode (press '1')
This mode does the following:
- Paddle becomes an interesting color
- Dot changes colors based on position on the screen
- "Dots Left" turns red when 2 or fewer dots are left
- Varying Speed Mode (press '2')
This mode does the following:
- The ball speeds up each time it hits the paddle
- The speed resets each time the player starts a new round (i.e. with a new dot)
- AI Mode (press '3')
This mode does the following:
- The left paddle is controlled by an "AI" and not the keyboard
- The AI should move the paddle at a speed of up to 5 pixels per timerFired call.
- The target on the paddle should not always just be the middle of the paddle, because that would quickly get boring. Instead, each time the dot hits the paddle, choose a random "paddle target offset" which is a possibly-negative value that we add to the paddle cy to determine where the AI should aim for the paddle to intersect the ball.
- While this paddle offset can in theory be up to half the paddle's height, limit it to about 40% of the paddle's height, since this seems to lead to more interesting and robust gameplay.
- Optional: Two-Player Mode (press '4')
This is an optional challenging feature, for those with time and inclination after collab4, and once the other three features are complete. This would be only for fun, not for bonus points. In two-player mode, there are two paddles! The paddle on the right is controlled by two keys of your choosing besides 'Up' and 'Down' (or you can flip it so 'Up' and 'Down' control the new rightmost paddle). Note that you can enable and disable AI Mode when in Two-Player mode. When enabled, AI controls the left paddle, and the human controls the right paddle.
- Discuss solutions to Super Pong
TAs will lead a discussion where all teams work together to derive the code that implements features 1, 2, and 3. As before, your TA will be individually grading you based on demonstrated effort and good collaboration, so participate!
- Video Discussion: Voting Machines
Watch this video on election security and then this video on voting machines and discuss! This is open-ended, though here are some starter questions if you need them:
- Does this affect your faith in electronic voting machines?
- In the future, do you think we will be able to trust electronic voting machines?
- What does this tell us about other electronic systems we design?
- Does this make you any more or less inclined to take a course in computer security?
Note: You are graded on attentiveness, participation, and courtesy. (Please pay attention and be respectful.)
- Midterm 1 Logistics
Do you have logistical questions about the midterm? Perhaps you'd like some advice on how to prepare? Your TA is available to help!
SUBMIT TO AUTOLAB!
Note the submission deadline at the top of the page. You must submit to autolab by that time. The time is in ET (Pittsburgh time). We strongly recommend you submit immediately after your group is finished! No work will be accepted after the deadline (unless of course your collab meeting is after the deadline).
Submit collab4.py to Autolab (Note: this is a python file, not a zip file!).
All you need to submit in collab4.py is your Super Pong game, with as many features as you were able to add!
(It is ok if you did not add all of the features, and while we hope your file runs, you won't receive a zero on the collab if it doesn't, as long as we can see your genuine effort in the code.) You are graded on demonstrated effort during the collab session, and your submission should provide extra evidence of that effort. There is no autograder.
If you realize you messed up your submission (i.e. submitted a blank file, zip file, etc) you can submit up to 5 times, but you really ought not need to.
Remember, no late work is accepted! Uploading to autolab takes a few minutes at most. Do not wait until the deadline and risk getting a zero.