Need some advice on assignment (menu symbols)

I have an assignment due today and I need some advice.
I have to plan and create some compelling visual art that visibly
changes in real times. I trying to transforming the menu bar into close bar
but I not sure how can I do it.

int a =520;
int b =350;
int c =250;

int aSpeed =4;
int bSpeed =4;

boolean paused;
void mouseClicked(){
paused =!paused;
if(paused)
noLoop();
else
loop();

}

void setup(){
  size(1280,720);
smooth();
}

void draw(){
  background(0);
  stroke(random(255),random(255),random(255));
  strokeWeight(10);
  strokeCap(SQUARE);
  
  a = a+ aSpeed;
  
  if(a> width || a<0){
    aSpeed = aSpeed *-1;
  }
  
   b = b+ bSpeed;
  
  if(b>height || b<0){
    bSpeed = bSpeed *-1;
  }
  
  line(a,b,a+c,b);
  line(a,b+30,a+c,b+30);
  line(a,b+60,a+c,b+60);
}

these are the lines of the bar

(not sure what a close bar is though)

just modify 30 and 60 (2*3) into a variable to let it move.

Chrisir

I trying to transform the menu bar into a cross animated but I not sure how can I do it.

Hello,

Please format your post as a courtesy to others here:
https://discourse.processing.org/faq#format-your-code

Here are some resources for you:

Resources

I encourage you to review the resources available here:

:)

here is how I see it…

maybe you can come up with better variable names such as x,y instead of a,b.

A cross can easily be achieved when you make

  • 1 line from the upper left corner down to the right and
  • 1 line from right corner down to the lower left corner.

Question: do you want an animation that changes from menu symbol to close symbol (cross)?

Regards,

Chrisir

1 Like