I'm trying to create a hangman game, but the problem is, how would I make it so that if the person presses "J", "A", and "V" on the keyboard, it moves onto word2();?
Code:public static void WORD1() { //Java
char key = ' ';
c.setFont(new Font("arial", Font.PLAIN, 50));
c.setColor(Color.BLACK);
c.drawString("_", 251, 472);
c.drawString("_", 287, 472);
c.drawString("_", 322, 472);
c.drawString("_", 357, 472);
while(key != 'J' || key != 'A' || key != 'V' || key != 'j' || key != 'a' || key != 'v')
{
key = c.getChar();
if (key == 'J' || key == 'j')
{
c.setFont(new Font("arial", Font.BOLD, 50));
c.setColor(Color.BLACK);
c.drawString("J", 250, 470);
}
else if (key == 'A' || key == 'a')
{
c.setFont(new Font("arial", Font.BOLD, 50));
c.setColor(Color.BLACK);
c.drawString("A", 285, 470);
c.drawString("A", 355, 470);
}
else if (key == 'V' || key == 'v')
{
c.setFont(new Font("arial", Font.BOLD, 50));
c.setColor(Color.BLACK);
c.drawString("V", 320, 470);
}
else if(key != 'J' || key != 'A' || key != 'V' || key != 'j' || key != 'a' || key != 'v')
{
COUNTER();
if(counter == 11)
{
c.clear();
c.setFont(new Font("arial", Font.PLAIN, 25));
c.setColor(Color.BLACK);
c.drawString("You him! Try the next word!", 125, 250);
c.setColor(Color.RED);
c.drawString("killed", 174, 250);
c.setFont(new Font("arial", Font.PLAIN, 15));
c.setColor(Color.BLACK);
c.drawString("The next word will automatically start in 5 seconds.", 150, 275);
WAIT();
c.clear();
counter = 0;
STAND();
WORD2();
}
}
}
}

