// Eggs that make the snake bigger class Egg{ int x, y; boolean big; int count; Tile t; Egg(){ while(true){ x = random(0, grid_size - 1); y = random(0, grid_size - 1); if(grid[y][x].walkable){ break; } } t = grid[y][x]; } // Big eggs mean bigger score Egg(boolean big){ this(); this.big = big; count = random(35,50); } void draw(){ if(!big){ stroke(200, 0, 0); fill(255, 0, 0); } else { stroke(0, 0, 200); fill(0, 0, 255); } rect(xc + x * grid_unit, yc + y * grid_unit, grid_unit, grid_unit); } }