|
|
@ -6,7 +6,7 @@ import java.awt.Graphics;
|
|
|
|
public class Tank {
|
|
|
|
public class Tank {
|
|
|
|
private int x,y;
|
|
|
|
private int x,y;
|
|
|
|
private Dir dir = Dir.DOWN;
|
|
|
|
private Dir dir = Dir.DOWN;
|
|
|
|
public static final int SPEED = 5;
|
|
|
|
private static final int SPEED = 5;
|
|
|
|
|
|
|
|
|
|
|
|
private boolean moving = false;
|
|
|
|
private boolean moving = false;
|
|
|
|
|
|
|
|
|
|
|
@ -46,9 +46,7 @@ public class Tank {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void move() {
|
|
|
|
private void move() {
|
|
|
|
if (!moving) {
|
|
|
|
if (!moving) return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (dir) {
|
|
|
|
switch (dir) {
|
|
|
|
case LEFT:
|
|
|
|
case LEFT:
|
|
|
|
x -= SPEED;
|
|
|
|
x -= SPEED;
|
|
|
|