Assignment 6: Invasion!
Due: Friday, October 13, 11:59:59 PM EST.
The following should be completed in cooperation with your latest assigned partner. (Partner assignments are listed on Piazza.) You may not share code for this assignment with anyone but your partner.
You must use the design recipe and The Style guidelines to receive full credit.
We’ve created an assignment skeleton assign6.zip for you to edit, please download the archive and edit the files you find inside. You must not change any file names.
1 Preparation
Make sure you have read and studied all of Part II of HtDP2e.
2 Finger Exercises with Lists
Edit the file list.rkt for this part of the assignment. Add your information to the standard file header at the top of the file.
Complete exercises 143–148 from HtDP2e Part 2.
3 The Invader Shoots Back
Copy your code from the invader-shots.rkt in assignment 5 into the provided file invaders-shoot.rkt for this part of the assignment. Edit the standard file header at the top of the file. Submit only invaders-shoot.rkt for this part of the assignment, not the original invader-shots.rkt.
The fight between your base and the invader is a bit one-sided at this point. It’s far more sporting to let the invader shoot back.
Extend your program such that the invader shoots down toward the base.
The invader shoots at a regular interval every N ticks of the clock. (Note: if N is small, several shots may be present on the screen at once.)
Each shot that hits the base costs 1 life.
The base starts with 3 lives.
The game ends when the base has no lives yet.
How does the game state that big-bang operates on need to change so the invader can fire arbitrarily many shots?
Which functions operate on the game state? How do they need to change to account for an invader that fires back?
Hint: Create a TODO list of all functions that need to change, then start working your way through that list.
4 Many Invaders
Continue this section in the same file as the last section (invaders-shoot.rkt).
Our TAs complain that the single-invader version of the game will be too easy for them. Modify your game to support a single row of an arbitrary number of invaders that can all shoot at the base.
It should be easy to modify the program to change the number of invaders in the row.
The whole row should move horizontally along the scene. Once the row meets the far left or the far right of the screen, the entire row should move down.
Knocking off the left-most or right-most invader doesn’t change how far left and right the row moves.
Each invader can shoot at its own regular interval. These intervals should vary invader-to-invader to make the game interesting.
How does the game state that big-bang operates on need to change so the invader can fire arbitrarily many shots?
Which functions operate on the game state? How do they need to change to account for multiple invaders rather than a single row?
5 Project submission
You should submit both of the provided files: list.rkt and invaders-shoot.rkt.
Submit your files directly to the submit server by uploading them. Select each of these files individually using the “Browse” button. Once you have selected all the files, press the “Submit project!” button. You do not need to put them in a zip file.