function handleClick(e){
      if(pause ==0){
      var rect = canvas.getBoundingClientRect();

      clickX = e.clientX - rect.left;
      clickY = e.clientY - rect.top;

        var xDiff = x - clickX;
        var yDiff = y - clickY;
        var dist = Math.sqrt(xDiff * xDiff + yDiff * yDiff);
        if(dist <= 40){
          killed = 1;
        }else{
           killed = 0;
        }
      }else{
        return;
      }
    }
/*------------------------------------
      Handle clicks in the game view port.
    --------------------------------------*/
Handle clicks in the game view port.
Handle clicks in the game view port .
function handleClick(e){
      if(pause ==0){
      var rect = canvas.getBoundingClientRect();
      clickX = e.clientX - rect.left;
      clickY = e.clientY - rect.top;
        var xDiff = x - clickX;
        var yDiff = y - clickY;
        var dist = Math.sqrt(xDiff * xDiff + yDiff * yDiff);
        if(dist <= 40){
          killed = 1;
        }else{
           killed = 0;
        }
      }else{
        return;
      }
    }
function handleClick ( e ) { if ( pause == 0 ) { var rect = canvas . getBoundingClientRect ( ) ; clickX = e . clientX - rect . left ; clickY = e . clientY - rect . top ; var xDiff = x - clickX ; var yDiff = y - clickY ; var dist = Math . sqrt ( xDiff * xDiff + yDiff * yDiff ) ; if ( dist <= 40 ) { killed = 1 ; } else { killed = 0 ; } } else { return ; } }
Handle clicks in the game view port.
Handle clicks in the game view port .