private void spawnFood() // simple random do foodX = (int)(Math.random() * W); foodY = (int)(Math.random() * H); while(collidesWithSnake(foodX, foodY));
128x160 resolution is a classic format for original Nokia feature phones like the 1600 or 1200 series. While the original Java files (
public void start() thread = new Thread(this); running = true; thread.start();
private boolean collidesWithSnake(int x, int y) for(int i=0; i<length; i++) if(snakeX[i]==x && snakeY[i]==y) return true; return false;