Alright so what I'm trying to do is when my character attacks (after the user pushes the ctrl button) I want the attack sprite to show, along with a simple slash graphic, then after less than a second I want the graphic gone and the sprite to return to standing mode. the problem is that it doesn't return, it just stays with the graphic and the attack sprite until the user moves.
public void paint(Graphics g){
bufferGraphics.drawImage(background,0,0,10000,600,this);
bufferGraphics.drawImage(sidebar,720,0,200,600,this);
bufferGraphics.drawImage(chara,px,py,128,128,this);
bufferGraphics.drawImage(sworda,px,py,128,128,this);
bufferGraphics.drawImage(hi,6,507,96,96,this);
bufferGraphics.drawImage(li,200,507,96,96,this);
bufferGraphics.drawImage(mi,394,507,96,96,this);
if(at==true){
if(dir.equals("right"))
bufferGraphics.drawImage(slice,px+100,py+20,128,128,this);
else
bufferGraphics.drawImage(slice,px-100,py+20,128,128,this);
at=false;
}
g.drawImage(offscreen,0,0,this);
}
Help would be much appreciated. I'm not sure if I need to include any other parts of my code or not. If I do just let me know and I'll post that part of the code when I get home from work. Thanks in advance.
p.s. I'm not using swing. I was ridiculed in some other forum because I posted my "swing" question in the wrong forum and this isn't even swing...