CMU 15-112 Summer 2018: Fundamentals of Programming and Computer Science
Homework 14 (Due Wed 20-Jun, at 5pm)



Notes to future instructors:

  1. 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.