Skip to content

Instantly share code, notes, and snippets.

@e-tverdokhleb
Created November 19, 2015 01:49
Show Gist options
  • Save e-tverdokhleb/da2804589d195d37646e to your computer and use it in GitHub Desktop.
Save e-tverdokhleb/da2804589d195d37646e to your computer and use it in GitHub Desktop.
void runTheGame() throws Exception {
int direction = 1;
while (true) {
if (direction == 1) {
if ((tankX + tank_move_step) >= (BF_WIDTH - desk_step)) {
tankX = 512;
direction = 0;
} else {
tankX += tank_move_step;
}
System.out.println(tankX);
}
if (direction == 0) {
if ((tankX - tank_move_step) <= 0) {
tankX = 0;
direction = 1;
} else {
tankX -= tank_move_step;
}
System.out.println(tankX);
}
repaint();
Thread.sleep(tank_speed);
}
}
@liuiv15
Copy link

liuiv15 commented Nov 19, 2015

Я уже много раз повторяла на занятиях, что код еужно вывешивать полностью, а не только один метод. Поэтому за игнорирование моих указаний, ставлю Вам плохо.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment