sketch.js
/*this is the animate function (Which is a slightly modified version
of our in class animated stoplight example) - I used this to 
animate the bubble by making it increae at a slow rate as if it is
being blown and then decreasing at a faster rate like it is popping.
*/
this is the animate function (Which is a slightly modified version
of our in class animated stoplight example) - I used this to
animate the bubble by making it increae at a slow rate as if it is
being blown and then decreasing at a faster rate like it is popping.
this is the animate function ( Which is a slightly modified version of our in class animated stoplight example ) - I used this to animate the bubble by making it increae at a slow rate as if it is being blown and then decreasing at a faster rate like it is popping .
function animate(){
  if(blowUp){
  bubbleHeight = bubbleHeight + 2; 
  bubbleWidth = bubbleWidth +2;
  }
  else{ 
  bubbleHeight = bubbleHeight - 20; 
  bubbleWidth = bubbleWidth -20;
  }
  if(bubbleWidth > 240 && bubbleHeight > 200){ 
    blowUp = false;
  }
  else if(bubbleWidth < 40 && bubbleHeight < 20){
    blowUp = true;
  }
}
function animate ( ) { if ( blowUp ) { bubbleHeight = bubbleHeight + 2 ; bubbleWidth = bubbleWidth + 2 ; } else { bubbleHeight = bubbleHeight - 20 ; bubbleWidth = bubbleWidth - 20 ; } if ( bubbleWidth > 240 && bubbleHeight > 200 ) { blowUp = false ; } else if ( bubbleWidth < 40 && bubbleHeight < 20 ) { blowUp = true ; } }
this is the animate function (Which is a slightly modified version
of our in class animated stoplight example) - I used this to
animate the bubble by making it increae at a slow rate as if it is
being blown and then decreasing at a faster rate like it is popping.
this is the animate function ( Which is a slightly modified version of our in class animated stoplight example ) - I used this to animate the bubble by making it increae at a slow rate as if it is being blown and then decreasing at a faster rate like it is popping .
//increases the size // decreases the size //if the width and height get to teh max point then set the boolean to false //if the width and height get to the lowest point then set the boolean to true 