this.collidesWith = function(sprite){
    // a method of the sprite object
    //check for collision with another sprite
    
    //collisions only activated when both sprites are visible
    collision = false;
    if (this.visible){
      if (sprite.visible){
	//define borders
	myLeft = this.x;
	myRight = this.x + this.width;
	myTop = this.y;
	myBottom = this.y + this.height;
	otherLeft = sprite.x;
	otherRight = sprite.x + sprite.width;
	otherTop = sprite.y;
	otherBottom = sprite.y + sprite.height;
    
	//assume collision
	collision = true;
	
	//determine non-colliding states
	if ((myBottom < otherTop) ||
	    (myTop > otherBottom) ||
	    (myRight < otherLeft) ||
	    (myLeft > otherRight)) {
	      collision = false;
	} // end if

      } // end 'other visible' if
    } // end 'I'm visible' if

    return collision;
  } // end collidesWith
  
  
  this.distanceTo = function(sprite){
      // method of the Sprite object
      //get centers of sprites
      myX = this.x + (this.width/2);
      myY = this.y + (this.height/2);
      otherX = sprite.x + (sprite.width/2);
      otherY = sprite.y + (sprite.height/2);
      diffX = myX - otherX;
      diffY = myY - otherY;
      dist = Math.sqrt((diffX * diffX) + (diffY * diffY));
      return dist;
  } // end distanceTo