assignment 3 oop – starlight

Exploring object oriented programming was fun and challenging. I struggled to find ideas on the artwork I want to do so I just started exploring with different shapes and playing with their movement using OOP. I started with small dots all around the screen jittering and thought of making them as stars. Then an idea of shining one of the stars’ light onto the ground sounded like a nice idea so I started playing with lines and their movement. I wanted to explore arrays and tried to incorporate that into the code which made the star light look nicer.

I wanted to incorporate a recursive tree and started exploring some codes online but I struggled to have something solid.

//star light movement
class movingLines1 {
  constructor() {
    this.x = random(width - width / 2);
    this.y = random(height - height / 2);
    this.z = 100;
    this.w = 100;
    this.speed = 2;
  }

  move() {
    this.x += this.speed;
    this.y += this.speed;
  }

  display() {
    stroke("#fff5dd");
    line(this.x, this.y, this.z, this.w);
  }
}

I am most proud of the star light as it took so much experimenting to get to the result I wanted. For future improvements, I would want to see how recursive trees work and incorporate that into the artwork.

Leave a Reply