String URL = "http://www.enn.com/feeds/energy.rss"; String[] lines; String[] words; int j = 0; int i = 0; float backdrop = 0; PFont font; PImage tree; PImage fire; PImage earth; void setup() { lines = loadStrings(URL); tree = loadImage("tree.gif"); fire = loadImage("fire_03.gif"); earth = loadImage("UltimateEarth.gif"); font = loadFont("Arial-Black-48.vlw"); textFont(font, 48); size(500, 500); smooth(); background(0); noCursor(); } void draw(){ frameRate(10); fill(backdrop, 20); rect(0, 0, width, height); if(j < lines.length){ String separators = WHITESPACE + "/<>*_;:?()\"-&@'.,"; words = splitTokens(lines[j], separators); if ( i < words.length) { if(words[i].startsWith("reduc")) { fill(60, 200, 80); text(words[i], random(300), 40); image(tree, random(450), random(30, 300)); image(tree, random(450), random(30, 300)); image(tree, random(450), random(30, 300)); } if(words[i].startsWith("green")) { fill(60, 200, 80); text(words[i], random(300), 40); image(tree, random(450), random(30, 300)); image(tree, random(450), random(30, 300)); image(tree, random(450), random(30, 300)); } if(words[i].startsWith("sun")) { fill(60, 200, 80); text(words[i], random(300), 40); image(tree, random(450), random(30, 300)); image(tree, random(450), random(30, 300)); image(tree, random(450), random(30, 300)); } if(words[i].startsWith("solar")) { fill(60, 200, 80); text(words[i], random(300), 40); image(tree, random(450), random(30, 300)); image(tree, random(450), random(30, 300)); image(tree, random(450), random(30, 300)); } if(words[i].startsWith("environment")) { fill(60, 200, 80); text(words[i], random(300), 40); image(tree, random(450), random(30, 300)); image(tree, random(450), random(30, 300)); image(tree, random(450), random(30, 300)); }if(words[i].startsWith("global")) { fill(60, 200, 80); text(words[i], random(300), 40); image(tree, random(450), random(30, 300)); image(tree, random(450), random(30, 300)); image(tree, random(450), random(30, 300)); } if(words[i].startsWith("planet")) { fill(60, 200, 80); text(words[i], random(300), 40); image(tree, random(450), random(30, 300)); image(tree, random(450), random(30, 300)); image(tree, random(450), random(30, 300)); } if(words[i].startsWith("electric")) { fill(60, 200, 80); text(words[i], random(300), 40); image(tree, random(450), random(30, 300)); image(tree, random(450), random(30, 300)); image(tree, random(450), random(30, 300)); } if(words[i].startsWith("renew")) { fill(60, 200, 80); text(words[i], random(300), 40); image(tree, random(450), random(30, 300)); image(tree, random(450), random(30, 300)); image(tree, random(450), random(30, 300)); } if(words[i].startsWith("recycl")) { fill(60, 200, 80); text(words[i], random(300), 40); image(tree, random(450), random(30, 300)); image(tree, random(450), random(30, 300)); image(tree, random(450), random(30, 300)); } if(words[i].startsWith("LEED")) { fill(60, 200, 80); text(words[i], random(300), 40); image(tree, random(450), random(30, 300)); image(tree, random(450), random(30, 300)); image(tree, random(450), random(30, 300)); } if(words[i].startsWith("ecolog")) { fill(60, 200, 80); text(words[i], random(300), 40); image(tree, random(450), random(30, 300)); image(tree, random(450), random(30, 300)); image(tree, random(450), random(30, 300)); } if(words[i].startsWith("efficien")) { fill(60, 200, 80); text(words[i], random(300), 40); image(tree, random(450), random(30, 300)); image(tree, random(450), random(30, 300)); image(tree, random(450), random(30, 300)); } if(words[i].startsWith("earth")) { fill(60, 200, 80); text(words[i], random(300), 40); image(tree, random(450), random(30, 300)); image(tree, random(450), random(30, 300)); image(tree, random(450), random(30, 300)); } if(words[i].startsWith("technolog")) { fill(60, 200, 80); text(words[i], random(300), 40); image(tree, random(450), random(30, 300)); image(tree, random(450), random(30, 300)); image(tree, random(450), random(30, 300)); } if(words[i].startsWith("wind")) { fill(60, 200, 80); text(words[i], random(300), 40); image(tree, random(450), random(30, 300)); image(tree, random(450), random(30, 300)); image(tree, random(450), random(30, 300)); } if(words[i].startsWith("hybrid")) { fill(60, 200, 80); text(words[i], random(300), 40); image(tree, random(450), random(30, 300)); image(tree, random(450), random(30, 300)); image(tree, random(450), random(30, 300)); } if(words[i].startsWith("protect")) { fill(60, 200, 80); text(words[i], random(300), 40); image(tree, random(450), random(30, 300)); image(tree, random(450), random(30, 300)); image(tree, random(450), random(30, 300)); } if(words[i].startsWith("biofuel")) { fill(60, 200, 80); text(words[i], random(300), 40); image(tree, random(450), random(30, 300)); image(tree, random(450), random(30, 300)); image(tree, random(450), random(30, 300)); } if(words[i].startsWith("planet")) { fill(60, 200, 80); text(words[i], random(300), 40); image(tree, random(450), random(30, 300)); image(tree, random(450), random(30, 300)); image(tree, random(450), random(30, 300)); } if(words[i].startsWith("power")) { fill(60, 200, 80); text(words[i], random(300), 40); image(tree, random(450), random(30, 300)); image(tree, random(450), random(30, 300)); image(tree, random(450), random(30, 300)); } if(words[i].startsWith("climate")) { fill(60, 200, 80); text(words[i], random(300), 40); image(tree, random(450), random(30, 300)); image(tree, random(450), random(30, 300)); image(tree, random(450), random(30, 300)); } if(words[i].startsWith("energy")) { fill(60, 200, 80); text(words[i], random(300), 40); image(tree, random(450), random(30, 300)); image(tree, random(450), random(30, 300)); image(tree, random(450), random(30, 300)); } else if(words[i].startsWith("auto")){ fill(255, 0, 0); text(words[i], random(300), 485); image(fire, random(450), random(30, 300)); image(fire, random(450), random(30, 300)); image(fire, random(450), random(30, 300)); backdrop -= 10; } else if(words[i].startsWith("vehicle")){ fill(255, 0, 0); text(words[i], random(300), 485); image(fire, random(450), random(30, 300)); image(fire, random(450), random(30, 300)); image(fire, random(450), random(30, 300)); backdrop -= 10; } else if(words[i].startsWith("emission")){ fill(255, 0, 0); text(words[i], random(300), 485); image(fire, random(450), random(30, 300)); image(fire, random(450), random(30, 300)); image(fire, random(450), random(30, 300)); backdrop -= 10; } else if(words[i].startsWith("carbon")){ fill(255, 0, 0); text(words[i], random(300), 485); image(fire, random(450), random(30, 300)); image(fire, random(450), random(30, 300)); image(fire, random(450), random(30, 300)); backdrop -= 10; } else if(words[i].startsWith("sulphur")){ fill(255, 0, 0); text(words[i], random(300), 485); image(fire, random(450), random(30, 300)); image(fire, random(450), random(30, 300)); image(fire, random(450), random(30, 300)); backdrop -= 10; } else if(words[i].startsWith("pollut")){ fill(255, 0, 0); text(words[i], random(300), 485); image(fire, random(450), random(30, 300)); image(fire, random(450), random(30, 300)); image(fire, random(450), random(30, 300)); backdrop -= 10; } else if(words[i].startsWith("oil")){ fill(255, 0, 0); text(words[i], random(300), 485); image(fire, random(450), random(30, 300)); image(fire, random(450), random(30, 300)); image(fire, random(450), random(30, 300)); backdrop -= 10; } else if(words[i].startsWith("OPEC")){ fill(255, 0, 0); text(words[i], random(300), 485); image(fire, random(450), random(30, 300)); image(fire, random(450), random(30, 300)); image(fire, random(450), random(30, 300)); backdrop -= 10; } else if(words[i].startsWith("fuel")){ fill(255, 0, 0); text(words[i], random(300), 485); image(fire, random(450), random(30, 300)); image(fire, random(450), random(30, 300)); image(fire, random(450), random(30, 300)); backdrop -= 10; } else if(words[i].startsWith("consum")){ fill(255, 0, 0); text(words[i], random(300), 485); image(fire, random(450), random(30, 300)); image(fire, random(450), random(30, 300)); image(fire, random(450), random(30, 300)); backdrop -= 10; } else if(words[i].startsWith("emi")){ fill(255, 0, 0); text(words[i], random(300), 485); image(fire, random(450), random(30, 300)); image(fire, random(450), random(30, 300)); image(fire, random(450), random(30, 300)); backdrop -= 10; } else if(words[i].startsWith("warm")){ fill(255, 0, 0); text(words[i], random(300), 485); image(fire, random(450), random(30, 300)); image(fire, random(450), random(30, 300)); image(fire, random(450), random(30, 300)); backdrop -= 10; } else if(words[i].startsWith("wast")){ fill(255, 0, 0); text(words[i], random(300), 485); image(fire, random(450), random(30, 300)); image(fire, random(450), random(30, 300)); image(fire, random(450), random(30, 300)); backdrop -= 10; } else if(words[i].startsWith("barrell")){ fill(255, 0, 0); text(words[i], random(300), 485); image(fire, random(450), random(30, 300)); image(fire, random(450), random(30, 300)); image(fire, random(450), random(30, 300)); backdrop -= 10; } else if(words[i].startsWith("aerosol")){ fill(255, 0, 0); text(words[i], random(300), 485); image(fire, random(450), random(30, 300)); image(fire, random(450), random(30, 300)); image(fire, random(450), random(30, 300)); backdrop -= 10; } else if(words[i].startsWith("fossil")){ fill(255, 0, 0); text(words[i], random(300), 485); image(fire, random(450), random(30, 300)); image(fire, random(450), random(30, 300)); image(fire, random(450), random(30, 300)); backdrop -= 10; } else if(words[i].startsWith("gas")){ fill(255, 0, 0); text(words[i], random(300), 485); image(fire, random(450), random(30, 300)); image(fire, random(450), random(30, 300)); image(fire, random(450), random(30, 300)); backdrop -= 10; } else if(words[i].startsWith("fuel")){ fill(255, 0, 0); text(words[i], random(300), 485); image(fire, random(450), random(30, 300)); image(fire, random(450), random(30, 300)); image(fire, random(450), random(30, 300)); backdrop -= 10; } else if(words[i].startsWith("diesel")){ fill(255, 0, 0); text(words[i], random(300), 485); image(fire, random(450), random(30, 300)); image(fire, random(450), random(30, 300)); image(fire, random(450), random(30, 300)); backdrop -= 10; } else if(words[i].startsWith("car")){ fill(255, 0, 0); text(words[i], random(300), 485); image(fire, random(450), random(30, 300)); image(fire, random(450), random(30, 300)); image(fire, random(450), random(30, 300)); backdrop -= 10; } i++; } else { i = 0; j++; image(earth, 0, 0, width, height); } } }