ICM_Week 5_Objects/Arrays

For this week’s assignment I experimented with using classes, objects and arrays.
The idea was to have an array of squares fill up the entire canvas and make each one of them rotate with a slight delay.


I knew I had to use the Push/Pop feature to make the rectangles rotate independently but placing that feature in different parts of the code gave me different results.

Results of trial 1 –
placed push/Pop in the draw loop in sketch


Result of trial 2 –
placed Push/Pop in the display function within the Class (Rectangle.js)



trial 3 –

Couldn’t figure out how to create a grid using array (both x and y)
So far I could only manage arraying in x



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 )

Connecting to %s