Hi, So I am making a game and I created a class called Board which is basically the engine of my game , and I implement it into a JFrame. Now, I have set a Boolean variable "ready_to_end" and if it is not true then the compiler executes the code to play the game. However if !ready_to_end, then I want to display a picture of Gman from Half Life, matter of a fact any other picture. But I can not seem to be able to?
My concern is that maybe the picture is being drawn, but behind what has already been drawn when the user was playing the game.
public void actionPerformed(ActionEvent e) { repaint(); } public void paint(Graphics g){ //........ else { // ISUUE HERE!!!! THANKS GUYS!!!!! super.paint(g); PlaySound.sound = new File("Music/chest_open.wav"); new Thread(PlaySound.play).start(); Image end; g.drawImage(m.getGman(), (p.getTileX() - 2) * 32, (p.getTileY() + 3) * 32, null); try { Thread.sleep(3000); } catch (Exception ee) { } PlaySound.sound = new File("Music/Gman_end.wav"); new Thread(PlaySound.play).start(); ImageIcon img = new ImageIcon("Pictures/Hfl3.jpg"); end = img.getImage(); g.drawImage(end, 0, 0, null); try { Thread.sleep(25000); } catch (Exception eeeee) { } Main.baseLevel.dispose(); } } }