function check(selector, userGuess){
  var userSelectedMissile = missileDisplay[selector];

  //Finds object to compare with user guess
  for(var i = 0; i < wordObjectArray.length; i++){
    if(userSelectedMissile === wordObjectArray[i].spanish
      || userSelectedMissile === wordObjectArray[i].french
      || userSelectedMissile === wordObjectArray[i].latvian
      || userSelectedMissile === wordObjectArray[i].german){
      var chosenWord = wordObjectArray[i];
    }
  }

  //Compare user guess
  if (userGuess === chosenWord.english){
    moveMissile();
    scoreTracker = scoreTracker + 1000; //If correct - increase score
    missilesLeft -= 1; //Tracks available guesses
    formArray[selector].className = 'mover';

    formArray[selector].removeChild(labelArray[selector]); //Remove from DOM
    formArray[selector].removeChild(inputArray[selector]);
  } else{
    //If wrong move all missiles
    moveMissile();
  }
}
//Takes in user input (userGuess) as a parameter - used to check answer
Takes in user input (userGuess) as a parameter - used to check answer
Takes in user input ( userGuess ) as a parameter - used to check answer
function check(selector, userGuess){
  var userSelectedMissile = missileDisplay[selector];
  for(var i = 0; i < wordObjectArray.length; i++){
    if(userSelectedMissile === wordObjectArray[i].spanish
      || userSelectedMissile === wordObjectArray[i].french
      || userSelectedMissile === wordObjectArray[i].latvian
      || userSelectedMissile === wordObjectArray[i].german){
      var chosenWord = wordObjectArray[i];
    }
  }
  if (userGuess === chosenWord.english){
    moveMissile();
    scoreTracker = scoreTracker + 1000; 
    missilesLeft -= 1; 
    formArray[selector].className = 'mover';
    formArray[selector].removeChild(labelArray[selector]); 
    formArray[selector].removeChild(inputArray[selector]);
  } else{
    moveMissile();
  }
}
function check ( selector , userGuess ) { var userSelectedMissile = missileDisplay [ selector ] ; for ( var i = 0 ; i < wordObjectArray . length ; i ++ ) { if ( userSelectedMissile === wordObjectArray [ i ] . spanish || userSelectedMissile === wordObjectArray [ i ] . french || userSelectedMissile === wordObjectArray [ i ] . latvian || userSelectedMissile === wordObjectArray [ i ] . german ) { var chosenWord = wordObjectArray [ i ] ; } } if ( userGuess === chosenWord . english ) { moveMissile ( ) ; scoreTracker = scoreTracker + 1000 ; missilesLeft -= 1 ; formArray [ selector ] . className = 'mover' ; formArray [ selector ] . removeChild ( labelArray [ selector ] ) ; formArray [ selector ] . removeChild ( inputArray [ selector ] ) ; } else { moveMissile ( ) ; } }
Takes in user input (userGuess) as a parameter - used to check answer
Takes in user input ( userGuess ) as a parameter - used to check answer
//Finds object to compare with user guess //Compare user guess //If correct - increase score //Tracks available guesses //Remove from DOM //If wrong move all missiles