Cookie-Planets

For no particular reason, here’s a bunch of cookies orbiting around Cookie Monster.

Cookies float around Cookie Monster.

Some of the things going on in this code include:

  • Programmatic object instantiation (the Cookie Monster creates a random number of cookies) — their placement relative to the center of the screen is then calculated and saved back into each cookie instance;
  • Using instanceID handles;
  • Randomizing names using an array (and assigning the outcome to each specific instance);
  • Detecting the closest cookie instance to your mouse (and returning the instanceID);
  • Drawing text and shapes over an instance;
  • And probably some other things, too. Questions? Let me know!

Here’s the package.

Leave a Reply

Your email address will not be published. Required fields are marked *