I have this line of code (repeated with a bit of change)
if (ropeChosen == 1){
g.drawImage(rope, 321, 0, 10, 505, this);
g.drawImage(rope, 521, 0, 10, 704, this);
g.drawImage(rope, 721, 0, 10, 703, this);
g.drawImage(rope, 921, 0, 10, 702, this);
if (p.idol2){
g.drawImage (idol, 275,485,100,100,this);
}else{
g.drawImage (snake, 300,505,50,100,this);
}
}
When a player choses a rope, and it is correct (they get the idol) it displays the rope pulled up, and the idol on the end, however if they chose the wrong one it should print a snake on the end of the pulled up rope. How come the ropes disappear when they pull up the snake, and not when they pull up the idol?
Also if I swap the idol, and the snake it displays the snake, and the ropes dissapear when they pull the idol. Why is this?
Thanks for any help.
P.S. All of the code is in the paintComponent method.