function takePlayer(oldy, oldx, newy, newx) {
  //Reset colours
  $('.even').css({
    'background': 'lightblue'
  })
  // change multiplier if it is a y value to signify different direction of movement
  var multiplier = 1;
  if (counterInPlay == "Y" && $('#b' + newx + newy).val() != kingPlayer) {
    multiplier = -1;
  }

  //See if a piece was taken
  if ((newy - oldy) == 2 || (newy - oldy) == -2) {
    takenY = ((newy - oldy) / 2) + oldy;
    takenX = ((newx - oldx) / 2) + oldx;
    table[takenY][takenX] = 0;

    //Change taken value to blank
    $('#b' + takenX + takenY).off().val("  ")
    //Take counter off counterInPlay
    removeCounterFromPlayer(counterOpposition)
    //See if there are any valid options for a second overtake
    var secondOvertake = locationOfSuroundings(newy, newx, 2)
    //If valid options array is returned a second overtake can happen
    if (secondOvertake.length > 0) {
      doubleTakeIndicator++;
      doubleTakeLocation = secondOvertake;
    }
  }
}
/**
 * @function takePlayer - If a player is overtaken the taken piece will be removed
 */
@function takePlayer - If a player is overtaken the taken piece will be removed
@function takePlayer - If a player is overtaken the taken piece will be removed
function takePlayer(oldy, oldx, newy, newx) {
  $('.even').css({
    'background': 'lightblue'
  })
  var multiplier = 1;
  if (counterInPlay == "Y" && $('#b' + newx + newy).val() != kingPlayer) {
    multiplier = -1;
  }
  if ((newy - oldy) == 2 || (newy - oldy) == -2) {
    takenY = ((newy - oldy) / 2) + oldy;
    takenX = ((newx - oldx) / 2) + oldx;
    table[takenY][takenX] = 0;
    $('#b' + takenX + takenY).off().val("  ")
    removeCounterFromPlayer(counterOpposition)
    var secondOvertake = locationOfSuroundings(newy, newx, 2)
    if (secondOvertake.length > 0) {
      doubleTakeIndicator++;
      doubleTakeLocation = secondOvertake;
    }
  }
}
function takePlayer ( oldy , oldx , newy , newx ) { $ ( '.even' ) . css ( { 'background' : 'lightblue' } ) var multiplier = 1 ; if ( counterInPlay == "Y" && $ ( '#b' + newx + newy ) . val ( ) != kingPlayer ) { multiplier = - 1 ; } if ( ( newy - oldy ) == 2 || ( newy - oldy ) == - 2 ) { takenY = ( ( newy - oldy ) / 2 ) + oldy ; takenX = ( ( newx - oldx ) / 2 ) + oldx ; table [ takenY ] [ takenX ] = 0 ; $ ( '#b' + takenX + takenY ) . off ( ) . val ( "  " ) removeCounterFromPlayer ( counterOpposition ) var secondOvertake = locationOfSuroundings ( newy , newx , 2 ) if ( secondOvertake . length > 0 ) { doubleTakeIndicator ++ ; doubleTakeLocation = secondOvertake ; } } }
@function takePlayer - If a player is overtaken the taken piece will be removed
@function takePlayer - If a player is overtaken the taken piece will be removed
//Reset colours // change multiplier if it is a y value to signify different direction of movement //See if a piece was taken //Change taken value to blank //Take counter off counterInPlay //See if there are any valid options for a second overtake //If valid options array is returned a second overtake can happen