Learn Create Your Own Split Screen

Next Page

We start by declaring a couple of global variables to keep track of how much our viewport has shifted from it's normal location.
var viewport_offset_x = 0; var viewport_offset_y = 0;
They start at zero because we haven't scrolled yet.