Index Beavers

When there are several objects of the same kind on the screen you can interact with each one of them separately. That is what Array Indexes are for, and now we have 10 new special challenges with arrays of cute beavers breaking it down for you!

Beavers

Indexes can become useful for example when turning and stepping towards a specific banana:

turnTo bananas[1]

step distanceTo bananas[1]

Or when telling each beaver to take a different number of steps:

beaver[0].step 3

beaver[1].step 7

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s