155156157158159160161162163164165
default: key.update(); if (food == null) { Random r = new Random(); food = new Food(screen, r.nextInt(WIDTH - Food.SIZE), r.nextInt(HEIGHT - Food.SIZE)); } bg.update(); snake.update(); food.update();