This assignment asks you to apply what you’ve learned to create an animated and interactive terrarium/aquarium/environment/game/etc. Need some inspiration? Checkout these examples from previous years! (in fact most) of these samples have gone above and beyond the assignment specifications (and thus earned extra credit), but please know that meeting the assignment’s minimum requirements is sufficient for earning all 40 points. Please calibrate your implementation according to your experience level with programming (i.e. do more if you’re more experienced): you’ll get out of it what you put into it. See the rubric below to get a sense of how you will be evaluated on this assignment. Then, download the starter files which are all the way at the bottom of the page
Note: Reminder, using code from any source, outside of the examples I provide in class and on edSTEM, that you did not write yourself is explicitly forbidden on our course syllabus. We reserve the right to audit your project via an interview with you. If there is any part of your program you cannot explain, it will be considered a violation of Northwestern’s Academic Integrity policy and you will receive an automatic 0 on the project.
Part 1. Create a creature function
Create a custom function called creature
that makes a creature of your choosing. Feel free to use/modify/improve upon the function you already made in HW5 (but make sure to not rely on any external files beyond cs110_p1.py
).
- center (positional): a tuple representing the (x, y) coordinate of the centerpoint of the creature.
- color_a (keyword): a string that specifies a primary color
- color_b (keyword): a string that specifies a secondary color
- size (keyword): an integer that controls the size of the creature.
- tag (keyword): a string that gives the creature a unique tag name.
You may also add any additional keyword parameters (i.e., they must be optional, not required) of your choosing to make your creature even more customizable (e.g.: theme_color='red'
, has_sunglasses=True
, etc.). Or, feel free to use the random
module to create creatures with ‘surprise’ features.
A reminder that your function’s need to match these names exactly!
You are also welcome to create additional creature functions (if you want different kinds of creatures to be present in your terrarium / aquarium). That said, please ensure that your main creature function is called creature
(for our grading pipeline). Any additional creature functions can be named anything that you want and work in any way you want.
Part 2. Create a landscape_object function
You have already experimented with clouds in Exercise 5. Here, you will make an object of your own choosing (e.g. a tree, a building, a rock, grass, a piece of coral, a bush, a constellation, etc.). To do this, you will create a custom function called landscape_object
that draws a single landscape feature of your choosing (i.e. a single rock; a single tree; a single building). It should be made up of at least 5 shapes with at least two different types of shapes. It should have at least 5 parameters that enable the caller to specify arguments for:
- center (positional): a tuple representing the (x, y) coordinate of the centerpoint of the background object.
- size (keyword): an integer that controls the width of the landscape object.
- color_a (keyword): a string that sets the primary color.
- color_b (keyword): a string that sets the secondary color.
- tag (keyword): a string that gives the landscape object a unique tag name.
You may also add any additional keyword parameters of your choosing to make your landscape object even more customizable (e.g.: christmas_themed=True
, texture='rough'
).
A reminder that your function’s need to match these names exactly!
You are also welcome to create several different landscape feature functions to make different landscape features. Note that while your main landscape function must be called landscape_object
, any additional landscape feature functions can be named anything that you want.
Part 3. Render your aquarium / terrarium
Then comes the fun part where you will render your terrarium. This involves (a) instantiating some background creatures (using your creature
function), and (b) creating some landscape features (using your landscape_object
function). This will all go in the
a. Background creatures
Create at least 5 different “background” creatures in your landscape (call your function 5 times), located at different positions, and with varying sizes (and colors and features — optional). You may use a loop (and perhaps a random function) to position your background creatures, or you can intentionally place your background creatures in specific places — or some combination of the two.
If you make multiple types of creatures, this can be 5 of one type of creature or 2 of creature 1 and 3 of creature 2, etc.
b. Landscape object
Create at least 5 instances of your landscape object (in the same manner as you did with your background creatures).
Part 4. Animate your landscape
Animate the creatures in your landscape by picking five of the following effects to implement:
# | Points | Task |
---|---|---|
1 | 3 points | Animate at least two of your creatures (and your environmental features if it makes sense to do so) so that if they move off of the screen they are recreated on the other side (wrap) |
2 | 3 points | Animate at least two things so that when they hit the edge of the screen, they bounce and go the opposite direction |
3 | 3 points | Spawn a new creature or landscape object when the user either clicks, drags, or right-clicks the screen (you can also use a keyboard event) |
4 | 3 points | Animate each of your creatures (all of your original 5) so that their movement is different (speeds AND movement patterns). There should be at least 3 distinct movement types (all linear movements will be considered equivalent; accelerating / decelerating would be considered non-linear) |
5 | 3 points | Enable your user to control one or more specific shapes using keyboard events (pressing the up/down arrow, using the spacebar, etc.) |
6 | 3 points | When you click (or right-click or double click) a feature, remove it from the screen (you can also assign a particular keyboard key to delete a creature but it needs to be able to be hit more than once without causing an error). This should only be able to delete that particular type of object, not any object. Make sure that if you delete a moving creature your program does not stop. |
7 | 3 points | Detect creature collisions and do something interesting inside of your animation if creatures collide |
8 | 3 points | Enable the user to reposition a specific feature by dragging it |
9 | 3 points | Make your creature animate with different versions like Mario in Tutorial 4 |
10 | 3 points | Create some game mechanics (space bar jumps or shoots, drag ‘flings’ an object, etc.) (advanced, see edSTEM for tips) |
11 | 3 points | Independently animate (or change the colors of) particular parts of your creature or landscape objects (advanced, see edSTEM for tips) |
12 | 3 points | Make some object on your screen shrink and grow in size over time |
13 | 3 points | Make some object on your screen change colors over time in some way that makes sense for your theme (note: the color cannot be changing every tick). |
If there’s some form of animation you would LIKE to implement but don’t see it here, talk to Prof. Bain or post on edSTEM and we’ll consider adding it to the rubric!
IMPORTANT: At the top of your file please include a short paragraph (bullet points are fine) as a comment that explains which animation features you chose to implement in your terrarium. IF WE DO NOT SEE THIS PARAGRAPH YOU MAY NOT RECEIVE POINTS FOR THE ANIMATION WORK YOU IMPLEMENTED.
NOTE: If you surpass the 15 points (i.e. 5 features), we will award up to 6 points extra credit for pursuing additional enhancements from the list above. So, a sixth feature would be 3 points extra credit, for example.
Part 5. Create a short video
Please create a short (~15 seconds) video of your terrarium / aquarium in action. To do this:
- Take a screen cast. The easiest way is to just open a Zoom meeting, share your screen, and hit record. (If you need help with this, make sure to come to office hours or take a look at these instructions)
- Submit it to the SEPARATE CANVAS ASSIGNMENT
Reference Materials
Code Samples
There are lots of samples/demos of how to include user interaction in our lecture files. There are also some advanced animation techniques in there for you to use as a reference.
Project Utilities File
The cs110_p1
file you have access to is documented here:
Project Utilities Documentation
NOTE: DO NOT EDIT THIS FILE. Since you’re not submitting it, your program won’t work when we try to run it.
Policy on sample code and collaboration
YOU MAY
- Make use of any sample code that I have provided you at any point during the course
- Help each other debug your code and discuss ideas together
YOU MAY NOT
- Use the internet for anything more than inspiration – all programming must be done yourself. If you want to do something advanced, come to OH and we’ll help you break it down into digestible parts
- Ask CS majors (or other more experienced people) to write code for you
- Share code — or look at your neighbor’s screen and transcribe their code. We have plagiarism detection software to flag code similarities — even when whitespace, variable names, and ordering have been changed
- Use someone else’s (another person or otherwise) code from any other CS 110 course past or present.
You will receive a 0 on the Project and be held in violation of our academic honestly policy if you do any of these things. Every quarter I have taught this course, someone has received a 0. Please try to break the trend.
What to Turn In
- Your project file to the Project 1 CODE Canvas assignment. MAKE SURE TO INCLUDE THE PARAGRAPH THAT EXPLAINS WHICH ANIMATION OPTIONS YOU IMPLEMENTED AS DESCRIBED in Part 4 above. Make sure it’s commented out so your program still runs.
- Your video as a
MP4
file (which is what Zoom creates) orMOV
orMKV
to the Project 1 VIDEO Canvas assignment.
Rubric
Feature | Points | Scoring Guidelines |
---|---|---|
Creature function | 6 | Function enables creature to be customized by size and position.
|
Landscape function | 6 | Function enables landscape object to be customized by size and position.
|
Render aquarium / terrarium | 6 |
|
Animate your landscape | 15 |
|
Code Quality | 4 |
|
Video | 3 |
|
Extra Credit | Maximum of 6 TOTAL points of any form | Extra features listed in animation / interaction section. |
Starter Files
Please note there are NO extensions for project submissions in this class. These will be graded by hand so make sure to write your program in a readable, organized manner.
P1 Starter File | P1 Module File | P1 Module Docs | edSTEM Hints Megathread |
---|