just assume that when you touch the edge you win.
I used code from a "How to" project on platformers. post your score in the comments!