I want to convert Pong.js to Processing. I have two error:
int[] walls=new int[4]; //= [];
//-----------------------
....
//------------------------
void wallAdder() {
if (millis()-lastAddTime > wallInterval) {
int randHeight = round(random(minGapHeight, maxGapHeight));
int randY = round(random(0, height-randHeight));
// {gapWallX, gapWallY, gapWallWidth, gapWallHeight, scored}
int[] randWall={width, randY, wallWidth, randHeight, 0};
walls.push(randWall); //here is error - Cannot invoke push(int[]) on the array int[]
lastAddTime = millis();
}
}
void wallRemover(int index) {
int[] wall =new int[walls[index]];
if (wall[0]+wall[2] <= 0) {
walls.splice(index, 1); //error - Cannot invoke push(int[]) on the array int[]
}
}
Help, pls!