converted javascript game to use jquery and html elements