Time flies and here I am sweet ICM homework #3. It’s a collaboration work by Karam and I, and basically we just used each other’s class and try to make some interaction! I got the triangle class from Karam and background idea from Gladys, and this work was inspired by reading The Nature of Code of Daniel Shiffman. Just finished chapter 1. Super good/tough stuff!!

Here’s my new born baby(click me click me)! It’s about a person who loves being rained, just enjoys the feeling of being miserable. When rain stops, the smile stops and background went blue. You can click your mouse and make this guy happy again.
For this, I wrote 5 classes… just couldn’t stop, and hit into wall sooo many time. I was like a small rooted tree in the corner of ITP floor on Monday. And here’s are some problems(all about using class in class) and answers(except the last one) from try-and-error process of myself.
- Where to put the moving code?
- make sure you can control the position in the { } in which the leading moving codes(e.g. x++) settle
- If things moves in different way?
- put moving codes separately in its own class
- Wants rains start from cloud
- don’t need to declare Cloud class in Rain class!! can use it directly(tearing)
- How to make smile affected by rain????
Still can’t solve the last problem. I guess there must be something wrong about my rain drops. I use distance between each rain drop and the man’s head to write some condition codes. The rain drops may seem to be affected well by the man, but I bet it’s actually not what we think they are, and that’s why although I could affect rain drops with the man, I failed to affect the smile with the rain drops? Too complicated. So in the end, I compromised and made the man smile when it’s raining and sad when it’s not.
Maybe it’s time to book an office hour with Dan.
And as usual, below are my baby’s bloody organs(codes).
Continue reading