删除set方法

master
kn5886348135 3 years ago
parent 3d66296c44
commit 22a515741c

@ -28,8 +28,8 @@ public class Tank {
this.x = x;
this.y = y;
this.dir = dir;
this.tf = tf;
this.group = group;
this.tf = tf;
}
public void fire(){
@ -46,18 +46,6 @@ public class Tank {
return x;
}
public void setX(int x) {
this.x = x;
}
public int getY() {
return y;
}
public void setY(int y) {
this.y = y;
}
public Group getGroup() {
return group;
}
@ -66,6 +54,10 @@ public class Tank {
this.group = group;
}
public int getY() {
return y;
}
public boolean isMoving() {
return moving;
}

@ -17,7 +17,7 @@ public class TankFrame extends Frame {
List<Bullet> bullets = new ArrayList<>();
List<Tank> tanks = new ArrayList<>();
public static final int GAME_WIDTH = 800,GAME_HEIGHT=600;
static final int GAME_WIDTH = 800,GAME_HEIGHT=600;
public TankFrame() {
setSize(GAME_WIDTH, GAME_HEIGHT);
@ -133,6 +133,7 @@ public class TankFrame extends Frame {
}
private void setMainTankDir() {
if (!bL && !bU && !bR && !bD) {
myTank.setMoving(false);
} else {

Loading…
Cancel
Save