Nature of Code: Week 3 assignment–Moon(Candy)

Documented by: Candy Bi

Project name: Rect Map

Professor: Moon

Date: 3/5/2019

Video: final version

While playing around with vector and object, I came up with the idea of making a map of rectangles that could have some interesting interactions with “mouse”.

I first make a map of reactangles using objects.

rect map

For better user experience, I change the opacity of background in draw function, so that each rect could leave some trails of moving.

Then I add the interaction of mousePressed–when the mouse is pressed, all the rects get random speeds and fly away.

I add another fuction of “addforce()”, in which I compare the mouse position and the position of each rect. By using this function, I successfully achieve the effect of rect would only move when the mouse hover on it.

HeartShape Image I drew. “Lily” text I wrote.

Leave a Reply