Anonymous user
Snake/Java: Difference between revisions
m
→Code: small changes
(created page for Java entry) |
m (→Code: small changes) |
||
Line 82:
stop();
initGrid();
treats = new LinkedList<>();▼
dir = 3;
Line 91 ⟶ 90:
score = 0;
▲ treats = new LinkedList<>();
snake = new ArrayList<>();
for (int x = 0; x < 7; x++)
Line 134:
gameOver();
else if (
gameOver();
Line 239:
void addTreat() {
if (treats.size() < 3) {
if (rand.nextInt(10) == 0) {▼
int x, y;
while (true) {
Line 269 ⟶ 271:
}
boolean
Point head = snake.get(0);
int nextCol = head.x + dirs[dir][0];
|