public void fighterMove() {
Thread th = new Thread(new Runnable() {
@Override
public void run() {
switch (getBtnCnt()) {
case 1:
case 2:
moveLeft += 60;
moveRight += 60;
break;
case 3:
moveLeft -= 60;
moveRight -= 60;
break;
case 4:
moveTop -= 60;
moveBottom -= 60;
break;
case 5:
moveTop += 60;
moveBottom += 60;
break;
}
try {
Thread.sleep(300);
} catch (Exception e) {
e.printStackTrace();
}
}
});
th.start();
}
public void fighterMover() {
stop = false;
Thread th = new Thread(new Runnable() {
@Override
public void run() {
while(!stop) {
if (atkCnt != 4) {
bmpID = image;
num = 8;
offy = 0;
offx += bmpID.getWidth() / 8;
if (offx >= bmpID.getWidth()) {
offx = 0;
}
try {
Thread.sleep(300);
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
});
th.start();
}
@Override
public void run() {
}
}