I currently have a rectangle shrinking its size upon impact with a ball, is there any way I can make sure that once it shrinks to a certain size it stops shrinking and just remains that size?
void paddle(PVector pad){;
if (ballLoc.x +ballsize/2>pad.x -playerW/2&&
ballLoc.x -ballsize/2<pad.x +playerW/2&&
ballLoc.y +ballsize/2>pad.y -playerH/2&&
ballLoc.y -ballsize/2<pad.y +playerH/2){
speedX *=-1;
audiosplayer.pause();
audiosplayer.rewind();
audiosplayer.play();
playerH-=5;
}
}
The second to last line is decreasing height of rectangle each time but I want it to stop after lets say it hits 20. What could I state in the code to do so?