collision


      this.collision = function(curPos, prevPos)
      {
        var collide = false; 
        var i; 
  
        if(curPos.getX() < this.left)
        {
          curPos.setX(this.left); 
          collide = true; 
        }
        else if(curPos.getX() > this.right)
        {
          curPos.setX(this.right); 
          collide = true; 
        }
        if(curPos.getY() < this.top)
        {
          curPos.setY(this.top); 
          collide = true; 
        }
        else if(curPos.getY() > this.buttom)
        {
          curPos.setY(this.buttom); 
          collide = true; 
        }
        return collide; 
      }  
      this.draw = function(ctx, scaleFactor)
      {
      }
    }