SRGunaraj Khatri Nice one, Also You can add rect width to rect x position to get rect right side of the for bounce. if ( this .x + this .width === canvas.width)Reply·Article·Apr 8, 2022·02 Game Loops