public class LoadStringsPHP extends PApplet { int x = 0; int y = 0; int s = 100; void setup() { size(500,500); fill(255); stroke(127); println("Loading"); String loadurl = "http://itp.nyu.edu/~sve204/qdphp/loadStrings.php?type=load"; String[] response = loadStrings(loadurl); int[] rints = int(split(response[response.length-1],",")); x = rints[0]; y = rints[1]; } void draw() { background(0); rect(x,y,s,s); } void mousePressed() { x = mouseX; y = mouseY; } void keyPressed() { println("Saving: x = " + x + " y = " + y); String saveurl = "http://itp.nyu.edu/~sve204/qdphp/loadStrings.php?type=save&x=" + x + "&y=" + y; String[] response = loadStrings(saveurl); for (int i = 0; i < response.length; i++) { println(":" + response[i]); } } }