How do I make a 2d runner game

So I wanted to make a 2d runner game and I want to make the canvas move when the sprite image reached the edge but I don't know how to do that.

see Scott's example here
EDIT: see also and several other examples in the developers library there...


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.