color[] palette = new color[7];
PVector playerPos = new PVector();
PVector food = new PVector();
bool UP_, DOWN_, LEFT_, RIGHT_;
String consonants = "bcdmnghrsfvwxyjkltpqz";
String[] threats = ['OMEGA', 'DELTA', 'GAMMA', 'BETA', 'SIGMA', 'ALPHA'];
Boolean letterType = random(100) > 25;
return new PVector(random(50, 200), 0, random(50, 200));
background(getSkyColour());
camera(500 - mouseX, 250 - mouseY, zoom, width / 2, height / 2, 0, 0, 1, 0);
translate(width / 2, 190, -100);
if (brightness(palette[0]) > 240) {
if (factoid == '...There is no one here.') {
directionalLight(120, 120, 120, 0, 1, 0);
text('Traces recovered: ' + String(foods) + '/10', 0, 0);
directionalLight(255, 255, 255, 0, 1, 0);
text('The area of', 0, 0);
text('Fishes found: ' + String(foods) + '/10', 0, 0);
translate(food.x, food.y - 20, food.z);
if (factoid == '...There is no one here.') {
translate(playerPos.x + 250, playerPos.y - 10, playerPos.z);
if (dist(food.x, food.z, playerPos.x + 250, playerPos.z) < 14) {
playerPos.z += (DOWN_ - UP_) * 3;
playerPos.x += (RIGHT_ - LEFT_) * 3;
playerPos.y = getYPos(playerPos.x, playerPos.z);
food.y = getYPos(food.x, food.z);
seed = int(random(10000));
if (factoid == '...There is no one here.') {
oceanName = threats[int(random(threats.length))] + "-" + String(int(random(0, 1000)));
oceanName = generateName();
for (int x = -300; x < 300; x += 10) {
for (int z = -300; z < 300; z += 10) {
translate(x + width / 2, y, z);
fill(lerpColor(color(35, 125, 125), getSkyColour(), constrain(1/((y-250) / 10) - 0.15, 0, 1)));
translate(width / 2, 200, 0);
translate(0, 150 + sin(tick / 33) * 10, 0);
fill(lerpColor(color(35, 125, 125), getSkyColour(), 0.5));
float getYPos(float _x, float _z) {
float y = noise(_x / 50, _z / 50, millis() / 5000);
return (100) * ((y / ((factoid == '...There is no one here.') + 1)) + 2.5);
return color(palette[0]);
for (int i; i < 7; i++) {
palette[i] = color(random(255), random(255), random(255));
int chunks = int(random(2, 7));
for (int i; i < chunks; i++) {
return name.charAt(0).toUpperCase() + name.substring(1);
int length = int(random(1, 3));
letterType = !letterType;
for (int j; j < length; j++) {
chunk += consonants.charAt(int(random(consonants.length)));
chunk += vowels.charAt(int(random(vowels.length)));
if (int(random(0, 100)) < 5) {
return '...There is no one here.';
adjectives = ['small', 'quiet', 'busy', 'pristine', 'magnificent', 'deep']
nouns = [' tourists', ' fishers', ' ships', ' turtles', ' fish']
randAdj = adjectives[int(random(adjectives.length))];
randNou = nouns[int(random(nouns.length))];
return 'This ' + randAdj + ' ocean has about \n' + String(int(random(0, 10000))) + randNou + ' visit each week.';