Void Token error
in
Programming Questions
•
3 years ago
Im trying to get the arrows to control the box's, I had the boxes -- and ++ left to right, But when I try to make the rows change numbers, I get a void token. Can anyone help me? Its my first week wtih processing!
int numSquares = 5;
int squareSize = 25;
int rowSize = 5;
void setup() {
size(500,500);
noStroke();
fill(255,255,255);
}
void draw() {
background(0);
for(int x=0;x<numSquares; x++) {
translate(squareSize+3,0);
rect(0,0,25,25);
}
background(0);
for(int y=0;y<rowsSize; y++) {
translate(squareSize+3,0);
rect(0,0,25,25);
}
void keyPressed() {
if(keyCode==UP) {
numSquares++;
}
if(keyCode==DOWN) {
numSquares--;
}
if(keyCode==LEFT) {
rowSize++;
}
if(keyCode==RIGHT) {
rowSize++;
}
int numSquares = 5;
int squareSize = 25;
int rowSize = 5;
void setup() {
size(500,500);
noStroke();
fill(255,255,255);
}
void draw() {
background(0);
for(int x=0;x<numSquares; x++) {
translate(squareSize+3,0);
rect(0,0,25,25);
}
background(0);
for(int y=0;y<rowsSize; y++) {
translate(squareSize+3,0);
rect(0,0,25,25);
}
void keyPressed() {
if(keyCode==UP) {
numSquares++;
}
if(keyCode==DOWN) {
numSquares--;
}
if(keyCode==LEFT) {
rowSize++;
}
if(keyCode==RIGHT) {
rowSize++;
}
1
