Automatically growing the field

It is time to turn our attention to the main functionality of the simulation - growing the contents of the field over time. To do this we will need to connect the buttons on our interface to methods that will automatically and manually grow the field.

The next section will focus on manually growing the crop, here we will look at automatically growing the crop.

The process

To grow the field contents automatically we will need to do the following:

  • Connect the 'automatically grow field' button to a suitable method
  • Have this method call the grow() method that is present in our Field class

The video below demonstrates how to do this.

Task 9

Use the above video to add the necessary functionality to grow the field contents automatically.