When you are ready, submit hw14.py to Autolab. For this homework you will have unlimited submissions.
This homework is not autograded.
This homework may be graded for style.
Notes to future instructors:
On line 89 consider crop1.kill() instead of crop1.dead = True
Some students stored the prices as properties, and then only had to overwrite init for the apple and corn classes. Consider adding something such that students have to overwrite at least one other method.
This hw was designed to be completed in a day. It's better to have students write an OOpy animation from scratch (but time is limited in the summer, which is why this assignment exists).
Farm Game [100 pts]
Fill in the Crop, AppleTree, and Corn classes to complete the given farm game animation. See the video below for further instructions.
Here are some more hints/clarifications for working on this:
You may be tempted to write all of the code before running anything. Don't do that. Instead make incremental changes. For example, you could comment out the body of mousePressed and timerFired, and then just get drawing to work by hard coding some crops in init.
While you may temporarily modify the rest of the code for debugging purposes, only the 3 classes should be changed in the final submission. TAs will check this when grading.
The video lists out a bunch of properties. Here they are for reference:
Apples start with radius 10.
Corn starts with a radius of 5.
Apples are done growing at radius 50.
Corn is done growing at radius 35.
Corn can be bought for 1 dollar and sells for 2.
Apples can be bought for 2 dollars. Apples sell for 5 dollars.
The video does not specify the growth rate for crops. You should decide the growth rate for each crop, but make sure apples are slower than corn.