switch (direction) {
case NONE:
break;
case LEFT:
x--;
break;
case RIGHT:
x++;
break;
}
if (x < RoadManager.LEFT_BORDER) {
x = RoadManager.LEFT_BORDER;
}
if (x > RoadManager.RIGHT_BORDER - width) {
x = RoadManager.RIGHT_BORDER - width;
}
return; а вот так выглядит метод. Что я egecnbk
package com.javarush.games.racer;
public enum Direction {
NONE,
RIGHT,
LEFT
}