OK I have changed the setup() method to
void setup() {
size(1080, 720);
nPiece=new Snake[dimStart];
for(int i = 0; i < nPiece.length; i++){
nPiece[i] = new Snake();
}
sSetup(nPiece);
}
the call to size() must be the first statement in setup so it can initialise the sketch and set important variables such as width and height which you use later to setup the snake pieces.
The statement
nPiece=new Snake[dimStart];
reserves memory to store a number of Snake objects but it does not create them. In my code these are created in the loop that follows. 