Created
November 19, 2015 01:49
-
-
Save e-tverdokhleb/da2804589d195d37646e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Я уже много раз повторяла на занятиях, что код еужно вывешивать полностью, а не только один метод. Поэтому за игнорирование моих указаний, ставлю Вам плохо.