You must have typed a weird character that happens to look normal within the "
xpos.length-1" and the "
ypos.length-1".
Also, you have an extra capital "p" on line 8.
Below is the working code:
- int[] xpos = new int[50];
- int[] ypos = new int[50];
- void setup() {
- size(200, 200);
- smooth();
- for (int i = 0; i < xpos.length; i++) {
- xpos[i] = 0;
- ypos[i] = 0;
- }
- }
- void draw() {
- background(255);
- for (int i = 0; i < xpos.length-1; i++) {
- xpos[i] = xpos[i + 1];
- ypos[i] = ypos[i + 1];
- }
- xpos[xpos.length-1] = mouseX;
- ypos[ypos.length-1] = mouseY;
- for (int i = 0; i < xpos.length; i++) {
- noStroke();
- fill(255-i*5);
- ellipse(xpos[i], ypos[i], i, i);
- }
- }