SnakeWorld game; int gridUnit = 8; int gridSize = 50; void setup(){ size(400,400); game = new SnakeWorld(gridSize, gridSize, 10); game.initEggs(); game.initSnakes(); strokeJoin(ROUND); ellipseMode(CORNER); noiseDetail(6, 0.7); for(int i = 0; i < game.world.wide; i++){ for(int j = 0; j < game.world.high; j++){ game.world.grid[i][j] = (int)(noise((1.0 / game.world.wide) * i, (1.0 / game.world.high) * j) * 24); } } framerate(24); } void draw(){ smooth(); noStroke(); background(0, 50, 30); for(int i = 0; i < game.world.wide; i++){ for(int j = 0; j < game.world.high; j++){ fill(game.world.grid[i][j] * 5, 60, 40); ellipse(i<<3,j<<3,8,8); } } game.draw(); } //imitate pmobile rand numbers int rand(int minimum, int maximum){ return int(random(minimum, maximum)); } int rand(int maximum){ return int(random(maximum)); }