After clicking on Scratch cat move him around with the arrow keys. He cannot move beyond the edge of the world of coloured blocks. This version also allows the world to rotate. Press C for clockwise or A for anti-clockwise - remember the world moves in the opposite direction! A modified version of https://scratch.mit.edu/projects/51479882/
The Scratch wiki includes a page on 'extensive scrolling' but only for x. This expands that to show how to do it for x and y. See the stage for comments. It should be possible to just change the GridX and GridY variables and use the rest of the code for your own projects. It's not perfect but shows it's possible.