01-06-rain-catcher-pt-6.js 479 B

1234567891011121314
  1. //bucket - Update Every Frame
  2. // if the bucket's powerup equals "frozen"
  3. // OR if the timer equals null
  4. if ( $this.powerup == "frozen" || $this.timer === null ) {
  5. //change the color of the bucket to blue
  6. $this.fill("#0000FF");
  7. $this.timer = createTimer(2000, function() {
  8. // after 2 seconds, powerup is null
  9. $this.powerup = null;
  10. }, false );
  11. } else if ( $this.powerup === null) {
  12. //change bucket color back to grey
  13. $this.fill("#BBBBBB");
  14. }